Hi,
Don't run the two commands separately in the terminal. The example should run as a powershell script. Please create a script in Windows Powershell ISE and press F5 to run it.
The Windows Powershell ISE
https://video2.skills-academy.com/en-us/powershell/scripting/windows-powershell/ise/introducing-the-windows-powershell-ise?view=powershell-7
Best Regards,
Ian
============================================
If the Answer is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.