Add Windows 10 only profile to PowerShell profile
This commit is contained in:
parent
0832da5147
commit
6caedc71dc
@ -46,6 +46,16 @@ if ($IsWindows) {
|
|||||||
# Windows 下的 vcpkg 初始化
|
# Windows 下的 vcpkg 初始化
|
||||||
Import-Module 'V:\githubs\vcpkg\scripts\posh-vcpkg'
|
Import-Module 'V:\githubs\vcpkg\scripts\posh-vcpkg'
|
||||||
|
|
||||||
|
# Windows 10 only
|
||||||
|
$is_windows_10 = [System.Environment]::OSVersion.Version.Major -eq "10"
|
||||||
|
if ($is_windows_10) {
|
||||||
|
# https://github.com/PowerShell/PowerShell/issues/13138
|
||||||
|
# 其实就是 patch 成 import-module appx -usewindowspowershell
|
||||||
|
$PSDefaultParameterValues['Import-Module:UseWindowsPowerShell'] = {
|
||||||
|
if ((Get-PSCallStack)[1].Position.Text -match '\bAppX\b') { $true }
|
||||||
|
}
|
||||||
|
Write-Host "loaded Windows 10 only profile"
|
||||||
|
}
|
||||||
Write-Host "loaded Windows only profile"
|
Write-Host "loaded Windows only profile"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user