Организация изменила мое местоположение «домашнего» сервера и настроена так, что у меня не может быть файлов в% USERPROFILE% \ Documents. Однако, когда я запускаю PowerShell, он по-прежнему указывает на предыдущий сервер для некоторых значимых переменных. Как мне это изменить?Как изменить переменные пути, связанные с профилем?
PROFILE \\OLDSERVER\USERS\lit\My Documents\WindowsPowerShell\Microsoft.PowerShell_prof...
PSCommandPath \\OLDSERVER\USERS\lit\My Documents\WindowsPowerShell\profile.ps1
PSScriptRoot \\OLDSERVER\USERS\lit\My Documents\WindowsPowerShell
Это на PSVersion 5.0.10586.117 на Windows 7.
PS H:\My Documents> $profile | get-member -type noteproperty
Name MemberType Definition
---- ---------- ----------
AllUsersAllHosts NoteProperty string AllUsersAllHosts=C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1
AllUsersCurrentHost NoteProperty string AllUsersCurrentHost=C:\Windows\System32\WindowsPowerShell\v1.0\Microso...
CurrentUserAllHosts NoteProperty string CurrentUserAllHosts=\\OLDSERVER\USERS\lit\My Documents\WindowsPowe...
CurrentUserCurrentHost NoteProperty string CurrentUserCurrentHost=\\OLDSERVER\USERS\lit\My Documents\WindowsP...
PS H:\My Documents> "$Env:USERPROFILE, $Env:HOMEPATH"
C:\Users\lit, \Users\lit
[about_automatic_variables] (https://technet.microsoft.com/en-us/library/hh847768 .aspx): '$ PSCommandPath' и' $ PSScriptRoot' определены в текущем скрипте. Что говорит '$ profile | get-member -type noteproperty'? – JosefZ