相关疑难解决方法(0)

为什么Get-ItemProperty不区分大小写,但Set-ItemProperty区分大小写?

我试图IIS为我的DefaultAppPool通道设置属性,PowerShell最后我得到了一个非常好奇的案例:

  • Get-ItemProperty不区分大小写.
  • Set-ItemProperty区分大小写.

有人知道我们为什么会有这种奇怪的行为吗?

PS C:\Windows\system32> Import-Module WebAdministration    
PS C:\Windows\system32> Get-ItemProperty -Path "IIS:\AppPools\DefaultAppPool" -Name Recycling.periodicRestart.privateMemory

...
Value                       : 27

PS C:\Windows\system32> Set-ItemProperty -Path "IIS:\AppPools\DefaultAppPool" -Name Recycling.periodicRestart.privateMemory -Value 10

PS C:\Windows\system32> Get-ItemProperty -Path "IIS:\AppPools\DefaultAppPool" -Name Recycling.periodicRestart.PrIVATeMemory

...
Value                       : 10

PS C:\Windows\system32> Set-ItemProperty -Path "IIS:\AppPools\DefaultAppPool" -Name Recycling.periodicRestart.PRIvateMemory -Value 15

PS C:\Windows\system32> Get-ItemProperty -Path "IIS:\AppPools\DefaultAppPool" -Name Recycling.periodicRestart.PrivateMemory

...
Value                       : 10 #should be 15 if case insensitive...
Run Code Online (Sandbox Code Playgroud)

iis powershell

8
推荐指数
1
解决办法
698
查看次数

标签 统计

iis ×1

powershell ×1