For testing, I'd like to output the execution of the line:
.\pgpwde --status --disk 0
to a text file, simply for testing and eventually integrate into a loop. But the text file just shows up blank. Also, when running the called powershell window, it just disappears even with the -noexit switch.
$Setloc = set-location "C:\Program Files (x86)\PGP Corporation\PGP Desktop"
$username = 'DOMAIN\Username'
$Password = 'PASSWORD' | ConvertTo-SecureString -Force -AsPlainText
$credential = New-Object System.Management.Automation.PsCredential($username, $Password)
Start-Process powershell.exe -Credential $credential -ArgumentList '$Setloc', "/C", ".\pgpwde --status --disk 0" | out-file "C:\users\USERNAME\Desktop\test.txt"