我推出的Windows PowerShell(通過按Windows鍵,鍵入「PowerShell的」並按下Enter鍵這將啓動C:\Windows\System32\WindowsPowerShell\v1.0
),然後鍵入$profile
然後按回車,看到WindowsPowerShell\Microsoft.PowerShell_profile.ps1
至於真正的路徑據我所知,這不是一個有效的途徑。我希望這樣的事情C:\Windows\...
當我鍵入$profile | Format-List * -Force
,但是,有一些進步,我得到
AllUsersAllHosts : C:\Windows\System32\WindowsPowerShell\v1.0\profile.ps1
AllUsersCurrentHost : C:\Windows\System32\WindowsPowerShell\v1.0\Microsoft.PowerShell_profile.ps1
CurrentUserAllHosts : WindowsPowerShell\profile.ps1
CurrentUserCurrentHost : WindowsPowerShell\Microsoft.PowerShell_profile.ps1
Length : 50
然而CurrentUserAllHosts
和CurrentUserCurrentHosts
仍非路徑。這些非路徑意味着什麼?它們是指某些隱藏的值,還是我需要在某處設置一些系統值?
這裏是我的$PsVersionTable.PsVersion
Major Minor Build Revision
----- ----- ----- --------
5 1 14393 206
這裏是Get-Host
Name : ConsoleHost
Version : 5.1.14393.206
InstanceId : a2a61a42-f2ee-46b9-b67a-ef441301bdb8
UI : System.Management.Automation.Internal.Host.InternalHostUserInterface
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData : Microsoft.PowerShell.ConsoleHost+ConsoleColorProxy
DebuggerEnabled : True
IsRunspacePushed : False
Runspace : System.Management.Automation.Runspaces.LocalRunspace
是否使用一些自定義的主機?這個命令的輸出是什麼'[Environment] :: GetFolderPath([Environment + SpecialFolder] :: Personal)'? – PetSerAl
如果缺少該定義,PowerShell是否會拒絕啓動? –
它給出了一個空的迴應 – Mark