OfficeDev / Office-IT-Pro-Deployment-Scripts

A collection of useful PowerShell scripts to make deploying Office 2016 and Office 365 ProPlus easier for IT Pros and administrators. If you have any feature requests or ideas for future scripts please add the idea to the issues list in this repository
http://officedev.github.io/Office-IT-Pro-Deployment-Scripts
MIT License
888 stars 840 forks source link

Unable to execute scripts or ps1 file #271

Closed urep102030 closed 7 years ago

urep102030 commented 7 years ago

When trying to execute the "remove-previousofficeinstalls.ps1" file I am getting an "The '<' operator is reserved for future use." error. This happens with the scripts as well. I have downloaded the files from the repository as-is. Any ideas?

AStigall commented 7 years ago

@urep102030 Does it tell you what line the error is occurring at?

urep102030 commented 7 years ago

@AStigall Yes 127, character 20

urep102030 commented 7 years ago

screenshot_126 @AStigall

snackeyez commented 7 years ago

I just had the same issue when trying to run command directly from powershell. When I followed the authors directions and opened command prompt first --> type powershell press enter --> type . .\remove-previousofficeinstalls.ps1 it worked

urep102030 commented 7 years ago

@snackeyez can you post a screenshot of how you are executing? This is not working for me, even using the cmd to go into powershell- I get the same error. @AStigall any help is appreciated!

snackeyez commented 7 years ago

image

urep102030 commented 7 years ago

screenshot_131

@snackeyez I'm doing the same thing but no luck.. files were downloaded directly from here too, have not tried to modify them

snackeyez commented 7 years ago

Ohh... Did you happen to right click on the .vbs links then click "save link as" ? If you look at the ps1 code and see any < in there, it's html, not powershell. Try clicking the link to the vbs code, then clicking raw. Copy and paste the raw code into a text document, then name it "Remove-PreviousOfficeInstalls.ps1" save. image

urep102030 commented 7 years ago

@snackeyez you're a lifesaver! That worked- another issue I ran into after the ps1 ran was a VBS script error. Had to save the VBS files with ANSI encoding- just in case anyone else runs into this! Thanks for all your help!