I have PowerShell installed on two different Server 2008 R2 systems. On one system, $HOME
is prepended to $profile
, but on the other nothing is prepended:
Server 1 (PowerShell 2)
PS C:\> echo $HOME
C:\Users\sysnetdom
PS C:\> $profile | format-list -force
CurrentUserAllHosts : C:\Users\sysnetdom\Documents\WindowsPowerShell\profile.ps1
CurrentUserCurrentHost : C:\Users\sysnetdom\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
�
Server 2 (PowerShell 3)
PS C:\> echo $HOME
C:\Users\sysnetdom
PS C:\> $profile | format-list -force
CurrentUserAllHosts : WindowsPowerShell\profile.ps1
CurrentUserCurrentHost : WindowsPowerShell\Microsoft.PowerShell_profile.ps1
(I snipped the AllUsers
paths because those are normal.)
This is a domain account with no assigned home directory. As I understand it, that should cause Windows to assign a default local home. It does, but on Server 2 it doesn't seem to be picked up by PowerShell 3.0.
Is there something I can do about this?
C:\Users\sysnetdom\Documents\WindowsPowerShell\Microsoft.PowerShell_profile.ps1
and server 2 does not.format-list
different on the two different versions of powershell? Try using$profile | Select-Object -ExpandProperty CurrentUserAllHosts
and$profile | Select-Object -ExpandProperty CurrentUserCurrentHost
. This should give you the raw output. However, my Windows 7 with PS 3.0 looks like your Server 1. Check the contents of the profiles. Maybe Server 2 is loading something that changes formatting.