我已经创建了这个基本的单行PowerShell脚本,如果我运行adAD 的cmdlet,然后运行查询的其余部分,则会执行该脚本.但是尝试在一起运行它们似乎只加载cmdlet并且不执行其余的cmd.
powershell.exe -command "&{Import-Module ActiveDirectory; Get-AdGroup -Server DC.Mydomain.com -filter 'name -eq "xxxx"'| set-Adgroup -Replace @{wWWHomePage='10.24.218.194'}}"
Run Code Online (Sandbox Code Playgroud)
为什么它不像这样一起运行?
powershell ×1