if I load the AppDeployToolkitMain.ps1 to create a new deployment I get an error in the Line 11262 - 11264 “It is not possible to call a method for an expression that has the value NULL.” and I don’t see where the error is.
Anytime I’ve encountered this error, it’s because in one way or another, I’ve tried to run the Deploy-Application.ps1 script in such a way that the main script (AppDeployToolkitMain.ps1) is missing or can’t be found.
No, the interesting thing is that I can install everything from Deployapplication.ps1, but when I try to load Deployapplicationmain.ps1 from Powershell ISE so that I can use the features in Deployapplication.ps1 this error occurs.
i meain this section in the main.ps1:
Sanitize the application details, as they can cause issues in the script
It occurs because one of the variable is $null not a [string] therefore it does not have a Trim() method.
Since you can’t call methods on $null, it throws an error. The bigger question is: why is it undefined?
Deploy-Application.ps1 defines all those variables so they are strings when Main.ps1 gets to them.