我對Powershell非常陌生。我一直在努力這個項目。我一直試圖獲得並保存在我的電腦中的這個文件。我嘗試不同的方式,並要求對堆棧溢出如何自動保存記事本文件並關閉Powershell中的記事本
當我執行該代碼
$ie = New-Object -ComObject 'internetExplorer.Application'
$ie.Visible= $true
$ie.Navigate("https://idp.appery.io/idp/")
while ($ie.Busy -eq $true){Start-Sleep -seconds 1;}
$usernamefield = $ie.Document.getElementByID('j_username')
$usernamefield.value= $username
$passwordfield = $ie.Document.getElementByID('j_password')
$passwordfield.value = $password
$Link=$ie.Document.getElementByID("loginBtn")
$Link.click()
while ($IE.Busy -eq $true)
{
Start-Sleep -Milliseconds 2000;
}
$ie.Navigate("https://appery.io/bttttn/rest/1/admin/databases")
當我執行上面的代碼,記事本會自動彈出的「database.json」,就找哪裏這個JSON文件在我的C盤,但我找不到它。這似乎剛剛打開文件, 所以我想
保存「database.json」我的文件夾
關閉記事本窗口,
我怎麼能這樣做?
非常感謝你!
更改文件關聯。 –