我不确定我错过了什么。这个 powershell 似乎与我的预期相反。有谁知道为什么?
$loadUserProfileValue = Get-ItemProperty "IIS:\AppPools\.net v4.5" -Name processModel.loadUserProfile.Value
Write-Host "Value: $loadUserProfileValue"
IF ($loadUserProfileValue -eq "False") {
Write-Host "Since Load User Profile is False, we will now set it to True"}
这是加载用户配置文件为真时的输出
Value: True
Since Load User Profile is False, we will now set it to True
这是加载用户配置文件为 False 时的输出
Value: False
该值被正确提取。变量 $loadUserProfileValue 是正确的。IF 声明与我的预期相反。
我可以将它交换为 -ne "True" 并且它似乎可以工作......但是为什么 -eq "False" 不起作用?