V4 Convert-ADTDeployment putting v3 uninstall and repair code into the v4 install function

Hello. Testing converting v3 package to v4. The v4 Invoke-AppDeployToolkit.ps1 has separate functions for install, uninstall and repair. Whereas the v3 Deploy-Application.ps1 separates these using a series of If-ElseIf statements.

When I use Convert-ADTDeployment, the v3 install, uninstall and repair sections are all placed into the v4 Install function. I’m assuming that this is wrong and that the v3 uninstall should be placed into the v4 uninstall function and the v3 repair section should be placed into the v4 repair function.

Can someone confirm that the v3 ps1 file is being converted correctly or not? And if not correct, is it possibly something to do with my ps1 file?

Perhaps I should just wait for the docs to be updated.

@DanGough do you mind checking this out when you have a moment?

I think it must be something I’ve done to my Deploy-Application.ps1 file because I’ve since downloaded a fresh 3.10.2 from Github and converted that (without any modification) using Convert-ADTDeployment. Everything went in the correct places - Install section into v4 install function, etc.

I suspect it might be caused by me adding some code in Deploy-Application.ps1 immediately after AppDeployToolkitMain is dot sourced. My code dot sources my own set of functions that I use throughout the install and uninstall sections. This is probably not the right way to do that but I’m pretty new at this and it is doing what I need at the moment.

Sorry if I wasted anyone’s time! :frowning:

2 Likes

While its more than a little embarrassing, I found the problem. Missing a closing bracket for the install section of deploy-application.ps1 immediately before the elseif that starts the uninstall section here:

} ElseIf ($deploymentType -ieq ‘Uninstall’) {

Fixed this and ran Convert-ADTDeployment again. It worked as expected with code from each section copied into the correct v4 function.

I should never have doubted the PSADT team. Sorry again! :frowning:

3 Likes

Love your honesty, and glad you found the problem.

1 Like

That’s why I :heart: him and gave him the solution nod, too.

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.