invoke-command

    0熱度

    1回答

    PowerShell腳本返回代碼 啓用PSRemoting在遠程計算機上 執行SETUP.EXE在遠程計算機上 禁用PSRemoting在遠程計算機上 如何確保在遠程計算機能夠執行setup.exe後禁用PSRemoting? 我是否在遠程計算機能夠執行setup.exe之前禁用PSRemoting? $password = get-content D:\Script\cred.txt | con

    0熱度

    1回答

    我正在拉一個以前創建的文本文件,該文件只是列出所有當前安裝的Windows更新的KB編號。我正在嘗試將此文件放入並呼叫wusa.exe並將其傳遞給KB號碼以執行卸載。 $a = Get-Content c:\hotfixid.txt foreach ($kb in $a) { $command = 'cmd /c wusa.exe /uninstall /kb:' + $kb.Trim

    1熱度

    2回答

    我試圖通過PowerShell腳本使用invoke-command使用配置文件作爲參數運行可執行文件。 以下是我在我的PowerShell腳本至今: $config = 'D:\EmailLoader\App.config' invoke-command -ComputerName SERVER-NAME -ScriptBlock {param($config) & 'D:\EmailLoade

    1熱度

    3回答

    所以這裏是什麼,我試圖做一個樣本: Invoke-Command [Connection Info] -ScriptBlock { param ( [various parameters] ) Start-Process [some .exe] -Wait } -ArgumentList [various parameters] 它連接到其他機器就好了

    6熱度

    1回答

    我在遠程會話下使用Invoke-Expression,並在拋出異常時返回RemoteException,但沒有任何堆棧跟蹤信息。 例子: try { Invoke-Expression "$command 2>&1" } catch { Write-Host $_ } 如果我排除重定向錯誤輸出(2>&1) - 我得到正確的錯誤,但它不需要調用調試控制檯(從$命

    0熱度

    1回答

    我可以能夠使用URL http://169.254.169.254/latest/meta-data/instance-id 在同一臺機器上得到AWS EC2 Windows計算機的IE瀏覽器的實例ID,當我使用PowerShell命令 Invoke-WebRequest http://169.254.169.254/latest/meta-data/instance-id 然後我收到以下錯誤

    0熱度

    1回答

    我正在腳本化任務以定期遠程重新啓動一些服務器應用程序池。我正在使用Invoke-Command,如下所示: Invoke-Command -ComputerName $server {Restart-WebItem "IIS:\AppPools\DefaultAppPool"} 這個工作就好了;但是,如果我參數化應用程序池如下 $appPool = "IIS:\AppPools\Default

    1熱度

    1回答

    在powershell v3中,您可以使用$executionContext.SessionState.InvokeCommand.PostCommandLookupAction和CommandScriptBlock修改參數。你如何在v2中完成同樣的事情? Powershell的3例如: $executionContext.SessionState.InvokeCommand.PostComman

    0熱度

    1回答

    我看到其他帖子,但沒有任何幫助我。請幫忙。 我從我的本地Win7桌面上運行了PowerShell4的以下cmdlet。 Invoke-Command -ComputerName COMPUTER123 -ScriptBlock { Import-Module '\\mycomany.com\PS\Task.SQL.psd1'} 我得到這個錯誤: The specified module '\

    0熱度

    2回答

    每當爲我公司的FTP客戶端創建一個FTP文件夾時,我必須在兩臺服務器上創建兩個文件夾;服務器A和服務器B.我試圖給出下面的例子。 E:\FTP\CompanyName E:\FTP\CompanyName\Incoming E:\FTP\CompanyName\Outgoing 在兩臺服務器上都需要看起來像這樣。手動操作並不難,但我想學習Powershell,那麼爲什麼不自動完成一項簡單的