我对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”我的文件夹
关闭记事本窗口,
我怎么能这样做?
非常感谢你!
更改文件关联。 –