I am getting the error “the term ‘adtSession.DirFiles’ is not recognized as the name of a cmdlet, script file or operable program.”
Here is the code I am trying to run: Start-ADTProcessAsUser -FilePath “$(adtSession.DirFiles)\NukeOneDriveProcessAccount.ps1 -ArgumentList ExecutionPolicy -Bypass”
I am not sure why it is throwing this error. I copied the code from the Start-ADTProcessAsUser example: Start-ADTProcessAsUser -FilePath “$($adtSession.DirFiles)\setup.exe” -ArgumentList ‘/S’ -SuccessExitCodes 0, 500
I haven’t had a lot of exposure to PSADT or powershell until recently so I am sure I am missing something. From what I can tell there is a line in the PSAppDeployToolkit.psm1 calling out $adtSession.DirFile
{
$adtSession.DirFiles = “$Path\Files”
$adtSession.DirSupportFiles = “$Path\SupportFiles”
}
So I am not sure why I am getting the error. I would appreciate any help.