awarre / Optimize-WsusServer

Comprehensive Windows Server Update Services (WSUS) cleanup, optimization, maintenance, and configuration PowerShell script.
https://github.com/awarre/Optimize-WsusServer
MIT License
354 stars 66 forks source link

First run Error #4

Closed ghermez closed 3 years ago

ghermez commented 3 years ago

Hi, Thanks for the PS code; I run it for the first time and received the following message:

PS ...\WSUS> .\Optimize-WsusServer.ps1 -FirstRun
At ...\WSUS\Optimize-WsusServer.ps1:169 char:126
+ ... etails px-3 px-md-4 px-lg-5 flex-wrap flex-md-nowrap" role="banner" >
+                                                                          ~
Missing file specification after redirection operator.
At ...\WSUS\Optimize-WsusServer.ps1:404 char:21
+         <svg class="octicon octicon-sign-out v-align-middle" viewBox= ...
+                     ~~~~~~~
Unexpected token 'octicon' in expression or statement.
At ....\WSUS\Optimize-WsusServer.ps1:485 char:68
+ ... g src="https://avatars.githubusercontent.com/u/24483278?s=60&amp;v=4" ...
+                                                                 ~
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 ....\WSUS\Optimize-WsusServer.ps1:487 char:18
+     <span class="dropdown-caret"></span>
+                  ~~~~~~~~~~~~~~~~~~~~~~~
Unexpected token 'dropdown-caret"></span>
  </summary>
  <details-menu class="dropdown-menu' in expression or statement.
At ...\WSUS\Optimize-WsusServer.ps1:493 char:61
+           <svg style="box-sizing: content-box; color: var(--color-ico ...
+                                                             ~
Missing expression after unary operator '--'.
At ....\WSUS\Optimize-WsusServer.ps1:493 char:61
+ ... yle="box-sizing: content-box; color: var(--color-icon-primary);" view ...
+                                                ~~~~~~~~~~~~~~~~~~
Unexpected token 'color-icon-primary' in expression or statement.
At ..\WSUS\Optimize-WsusServer.ps1:493 char:61
+           <svg style="box-sizing: content-box; color: var(--color-ico ...
+                                                             ~
Missing closing ')' in expression.
At ..\WSUS\Optimize-WsusServer.ps1:493 char:79
+ ... le="box-sizing: content-box; color: var(--color-icon-primary);" viewB ...
+                                                                 ~
Unexpected token ')' in expression or statement.
At ...\WSUS\Optimize-WsusServer.ps1:493 char:92
+ ... g: content-box; color: var(--color-icon-primary);" viewBox="0 0 16 16 ...
+                                                                 ~
Unexpected token '0' in expression or statement.
At ....\WSUS\Optimize-WsusServer.ps1:493 char:94
+ ...  content-box; color: var(--color-icon-primary);" viewBox="0 0 16 16"  ...
+                                                                 ~
Unexpected token '0' in expression or statement.
Not all parse errors were reported.  Correct the reported errors and try again.
    + CategoryInfo          : ParserError: (:) [], ParseException
    + FullyQualifiedErrorId : MissingFileSpecification

The PowerShell version is 5 and I have run it on Windows Server 2016 Please help me..

awarre commented 3 years ago

Not sure what you're running there, but it definitely isn't the Optimize-WsusServer script with any sort of normal input. You have some sort of HTML code being picked up as input.

The weird input the script is getting is shown in your errors:

etails px-3 px-md-4 px-lg-5 flex-wrap flex-md-nowrap" role="banner" >

<svg class="octicon octicon-sign-out v-align-middle" viewBox=

Maybe the file was saved in a way that included the GitHub page itself?

I'd redownload the raw Optimize-WsusServer.ps1 file and try again.