我製作了一個PowerShell腳本來查找網絡密碼,但是它在打開後立即關閉。我嘗試使用Read-Host命令,但它不起作用。這裏是我的腳本:腳本在立即運行後關閉,並且Read-Host -Prompt不起作用
$Output = netsh wlan show profiles name="enter network here" key=clear
$SSIDSearchResults = $Output | Select-String -Pattern 'SSID Name'
$ProfileName = ($SSIDSearchResults -split ":")[-1].Trim() -replace '"'
$PwSearchResult = $Output | Select-String 'Key Content'
$PW = ($PwSearchResult -split ":")[-1].Trim() -replace '"'
[pscustomobject] @{
WifiProfileName = $ProfileName
Password = $PW
}
嗨,你使用ISE編寫PowerShell代碼?點擊**開始**,輸入** ise **並點擊**輸入**。 – sodawillow
是的,我使用PowerShell ISE。我的所有問題都已得到解決 –
將問題標記爲已回答的方式是使用可幫助您的答案旁邊的複選標記。 – Matt