Running a powershell script as a kscript isn't working
The script looks like this:
$result = manage-bde -protectors -get c: -type recoverypassword
$id = $result -match "ID" | Out-String
$id = $id.Substring(10)
$revid = $id -replace "`t|`n|`r",""
$finalid = "$revid"
manage-bde -protectors -adbackup c: -id $finalid
Per the documentation I found here, I set up a kscript to run a batch file that calls the powershell script. I have the batch script running the following command:
powershell.exe -ExecutionPolicy Bypass -File "C:\ProgramData\Dell\KACE\kbots_cache\packages\kbots\127\bitlockerBackup.ps1"
The execution policy on the computer is actually set to unrestricted, so that shouldn't be an issue anyway. Any ideas on why this isn't working?
EDIT: I've updated the code to show my latest iteration, wherein I'm only calling the Powershell program once in the batch file. It still doesn't resolve the problem.