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
887 stars 841 forks source link

Unable to get .\Remove-PreviousOfficeInstalls.ps1 to Run #304

Open Desibouy opened 6 years ago

Desibouy commented 6 years ago

Hello,

So I've been having issues with installing 365, 2013, 2010 and 2007. I'm getting loads of errors - See my post here - https://www.reddit.com/r/Office365/comments/7z1fub/unable_to_install_office_365_or_2013_300xx_errors/

I've followed the guide as best as I can, I'm a noob so please be gentle. I'm getting several errors - 1. the script is not digitally signed. I've managed to bypass this using this code Unblock-File -Path C:\Scripts\Remove-PreviousOfficeInstalls.ps1

2. Then when I try to run it again I'm getting this error -

+ </a             </li>
+                   ~
The '<' operator is reserved for future use.
At C:\scripts\Remove-PreviousOfficeInstalls.ps1:136 char:19
+ </a             </li>
+                   ~
The '<' operator is reserved for future use.
At C:\scripts\Remove-PreviousOfficeInstalls.ps1:141 char:19
+ </a             </li>
+                   ~
The '<' operator is reserved for future use.
At C:\scripts\Remove-PreviousOfficeInstalls.ps1:146 char:19
+ </a             </li>
+                   ~
The '<' operator is reserved for future use.
At C:\scripts\Remove-PreviousOfficeInstalls.ps1:150 char:19
+ </a             </li>
+                   ~
The '<' operator is reserved for future use.
At C:\scripts\Remove-PreviousOfficeInstalls.ps1:7646 char:227
+ ... g:0;display:inline"><input name="utf8" type="hidden" value="&#x2713;" ...
+                                                                 ~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double
quotation marks ("&") to pass it as part of a string.
At C:\scripts\Remove-PreviousOfficeInstalls.ps1:7649 char:10
+ </form </div>
+          ~
The '<' operator is reserved for future use.
At C:\scripts\Remove-PreviousOfficeInstalls.ps1:7665 char:24
+       <li class="mr-3">&copy; 2018 <span title="0.22830s from unicorn ...
+                        ~
The ampersand (&) character is not allowed. The & operator is reserved for future use; wrap an ampersand in double
quotation marks ("&") to pass it as part of a string.
At C:\scripts\Remove-PreviousOfficeInstalls.ps1:7665 char:36
+       <li class="mr-3">&copy; 2018 <span title="0.22830s from unicorn ...
+                                    ~
The '<' operator is reserved for future use.
At C:\scripts\Remove-PreviousOfficeInstalls.ps1:7665 char:42
+ ...  2018 <span title="0.22830s from unicorn-3161165770-cdhjc">GitHub</sp ...
+                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token 'title="0.22830s from unicorn-3161165770-cdhjc">GitHub</span>' in expression or statement.
Not all parse errors were reported.  Correct the reported errors and try again.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : RedirectionNotSupported`

3. I also tried running it like - Remove-PreviousOfficeInstalls.ps1, as I'm already in the correct directory and it gave me this message

Suggestion [3, General]: The command Remove-PreviousOfficeInstalls.ps1 was not found, but does exist in the current location. Windows PowerShell does not load commands from the current location by default. If you trust this command, instead type: ".\Remove-PreviousOfficeInstalls.ps1". See "get-help about_Command_Precedence" for more details.

  1. Then I tried .\Remove-PreviousOfficeInstalls.ps1, and getting the same long error - SEE ABOVE

  2. I've tried to run it like this but getting the same above error - . .\Remove-PreviousOfficeInstalls.ps1 Off_10.vbs (renamed the file)

Darkybald commented 6 years ago

It seems like you copied the html page to the .ps1 file. Make sure the actual powershell code is in the .ps1 file.