I am new to PowerShell scripting. I have been given the task to understand what a PowerShell script is doing.
I am stuck at following line:
& $basePath\CPAU.exe -u $($sqlUser.UserName) -p $(ConvertTo-UnsecureString $sqlUser.Password) -ex "cmd /c (sqlcmd $($sqlArgs -join ' ') > $outputFile && echo TRUE > SUCCESS) || echo TRUE > FAILURE" -wait -nowarn -hide
It feels like the script is trying to execute some sort of sql command. However, I am not sure of starting "&" symbol.
Also, could CPAU.exe be an external in basepath? And what do -p, -u, and -ex enforce?
Next line:
if (!(Test-Path .\SUCCESS))
{
#some more code
}
In above if statement, what does .\SUCCESS mean? Doesn't Test-Path operate on some sort of path to test whether it exists or not?
-uusername,-ppassword and-exis probably execute?||is anorcondition.