PS C:\WINDOWS\system32> Invoke-Command -ComputerName "UABEP1" -ScriptBlock { Get-ChildItem -Path IIS:\AppPools }
Cannot find drive. A drive with the name 'IIS' does not exist.
+ CategoryInfo : ObjectNotFound: (IIS:String) [Get-ChildItem], DriveNotFoundException
+ FullyQualifiedErrorId : DriveNotFound,Microsoft.PowerShell.Commands.GetChildItemCommand
+ PSComputerName : UABEP1
在远程计算机上本地运行命令将返回应用程序池列表。是否有必须更改的安全设置?
答案 0 :(得分:3)
您忘记加载Web管理模块:
{ Import-Module WebAdministration; Get-ChildItem -Path IIS:\AppPools }