PDT Functions - Testing line by line

I thought I had this figured out but for some reason I’m still struggling…

When I’m going through testing line by line, I often get a not recognized as a name of a cmdlet.

I know I’m getting this because the cmdlets that I’m using are from the PDT and they will only work if you are calling them from the appdeploytoolkitmain.ps1.

In the past I thought I would call that file, it would load in and then I would be able to use the functions within the PDT such as ‘send-keys’ etc etc.

We’ve been using this for a bit now and each week I feel like I’m getting better and better and then I have moments like this that bring me right back down.

Any direction on this would be greatly appreciated.

This is a common question when developing packages with our toolkit.

You need to dot source the main.ps1 script. Deploy-Application.ps1 shows exactly how the toolkit dotsources it.

Keep in mind that the script wont be loaded if Execution-Policy blocks it. GPOs can block it even if you have elevated permissions, otherwise elevated permissions are enough it change it for the machine.

You can also dotsource the main script inside your profile script.