Worklet: Automatic OS Upgrade to Windows 10 1909

@awhitman - thanks for following up on this. I read the manual execution and skipping the evaluation and it didn’t even click. Thanks for the explanation.

Here’s more detail to the issue I experienced:

Using Chrome 81.0.4044.113, this is how the code block appears on screen:

Notice the “fancy” quotes.

When you copy the code (using the “copy to clipboard” widget) and paste into automox, it keeps the “fancy” quotes, which does not properly enclose the string, which means it isn’t being evaluated correctly:

If I change the quotes to either single or double, it properly encloses the string (the text turns green):
Single Quotes

Double Quotes

Same issue in Firefox 75.0

Just an oddity… not sure why it is happening.

1 Like

I can concur with this…
Mine acted the same way. It was not deleting the iso. in fact some of my 1903’s were doing the same thing, and I checked the “fancy” quotes, and they were there as well. Changed to regular quotes and the string enclosed properly. Haven’t checked if the iso deleted or not, but I’m guessing it probably did, since yours did.


Thanks so much for noticing this! It must be the way I moved it into the community post. The one in my Github that I used to post this is using double quotes.

I have made the appropriate change to the original code post for both 1909, and 1903.

Thanks again!

1 Like

Thanks for figuring this out @ews - I gave you the community bug finder badge for giving us the solution!


We haven’t had much luck getting this to work. Checking the activity log we see the following. When I search for the c:\windows\temp\output.csv file referenced one does not exist. Any ideas on how best to identify our issue?

You cannot call a method on a null-valued expression. At C:\ProgramData\amagent\execDir807239699\execcmd579763798.ps1:41 char:25 + $objs | Foreach-Object {$.href = ($.href).Replace(‘amp;’,’’)} + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:slight_smile: [], RuntimeException + FullyQualifiedErrorId : InvokeMethodOnNull C:\ProgramData\amagent\execDir807239699\execcmd579763798.ps1 : .iso linked was successfully created but download Failed. Reference c:\windows\temp\output.csv for more information or contact Automox Support + CategoryInfo : NotSpecified: (:slight_smile: [Write-Error], WriteErrorException + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,execcmd579763798.ps1

Sorry about that. I’ve notified @awhitman to come take a look and see if he can figure out where it’s failing.


Take the remediation code and try running it directly on a device. It looks like the download link is failing, so I wonder if it has something to do with the Worklet being executed remotely.

Copy the remediation into a x86 Powershell ISE admin session directly on one of the devices and see if it errors out there as well. I tested it and it worked for me.

Wow, for the first time in my life I found an active discussion about the same issue I am experiencing. Amazing

I am doing a trial of Automox and experiencing the same issue Chris_2.0 is seeing. I just tried your recommendation awhitman - running the remediation code manually in Powershell and low and behold the .ISO file is actually downloading now.

I’m not sure what this means for deploying it as intended?

1 Like

Unfortunately it errors out locally for me as well

You cannot call a method on a null-valued expression.
At line:40 char:25

  • $objs | Foreach-Object {$.href = ($.href).Replace(‘amp;’,’’)}
  •                     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    • CategoryInfo : InvalidOperation: (:slight_smile: [], RuntimeException
    • FullyQualifiedErrorId : InvokeMethodOnNull

@Ckraem608 Did you have to make any adjustments to the remediation code to run it locally or does it work as posted above?

Chris - I did not make any adjustments, just copied the code and pasted into x86 Powershell ISE. The download started right away. Unfortunately I did get a pop-up on that machine from UAC asking me to confirm I wanted to make changes. Afterwards it installed and rebooted automatically. Hopefully I can figure it out so it is seamless.

I copied the code from the blog post not this post though.

I think the code in this topic has been updated since the blog post was made, so you’ll want to use the top post which @awhitman keeps updated, rather than the blog post.

1 Like

I need to give this another go as tried a few weeks ago and ISO downloaded but install didn’t happen. Need to work through why.

@trilly what happens when you take the remediation code and try to run it locally on the device using Powershell x86 ISE? It will probably throw and error that we can look at to help root cause this.

1 Like

@awhitman, I’ll do that, run in Powerhsell that is, missed that trick when looking at it last time, obvious thing to try!

sounds good! Send me the error that you see and I will help you through it.

Have a good weekend!

1 Like

Will there be a worklet soon for 2004?

1 Like

Hi Allan,

This is being worked on as we speak and will be available soon.


1 Like

@awhitman – thanks for getting back to me. That’s great news!

@awhitman you might want to check out my companies github repo

Ive updated my original function to grab the latest ISO download link instead of a hard-coded copy. I think it relies on powershell 5 code so it no longer works on macOS and linux but it could probably be modified to do so if thats your thing. And as long as MSFT doesnt change the schema it will always grab the latest version available. In addition to that there’s also a function that does the ISO download, mounting and install for you all in one step.

Theres also function that uses the windows update assistant exe file to silently upgrade as well. This is our preferred method over the ISO install. The reboot to apply the update is shorter meaning less downtime for the user.

Finally, theres a function that installs the 1903>1909 enablement package. These are super fast to apply. If MSFT releases one for 2004, we will update the function, as this is the smoothest way to upgrade windows yet.