awarre / Optimize-WsusServer

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

Errors #16

Closed jgcracknell1 closed 2 years ago

jgcracknell1 commented 2 years ago

Hi

I am getting this as errors when running the script

PS C:\a> .\Optimize-WsusServer.ps1 -FirstRun At C:\a\Optimize-WsusServer.ps1:235 char:180

  • ~ The '<' operator is reserved for future use. At C:\a\Optimize-WsusServer.ps1:243 char:148
  • ... -view-component="true" class="js-details-target btn-link"> <svg aria ...
  • ~ The '<' operator is reserved for future use. At C:\a\Optimize-WsusServer.ps1:246 char:16
  • ~ The '<' operator is reserved for future use. At C:\a\Optimize-WsusServer.ps1:261 char:7
  • ~ The '<' operator is reserved for future use. At C:\a\Optimize-WsusServer.ps1:266 char:7
  • ~ The '<' operator is reserved for future use. At C:\a\Optimize-WsusServer.ps1:271 char:7
  • ~ The '<' operator is reserved for future use. At C:\a\Optimize-WsusServer.ps1:276 char:7
  • ~ The '<' operator is reserved for future use. At C:\a\Optimize-WsusServer.ps1:281 char:7
  • ~ The '<' operator is reserved for future use. At C:\a\Optimize-WsusServer.ps1:286 char:7
  • ~ The '<' operator is reserved for future use. Not all parse errors were reported. Correct the reported errors and try again.
  • CategoryInfo : ParserError: (:) [], ParseException
  • FullyQualifiedErrorId : RedirectionNotSupported
  • exel2000 commented 2 years ago

    Hi, I am also getting this error and not sure how to proceed. Thanks! -Sam

    awarre commented 2 years ago

    Hey @jgcracknell1 and @exel2000,

    How are you downloading the script? You can either download the ZIP file from the releases page, or click the Raw button on the PS1 file page.

    image

    It appears you've download the GitHub page for the script and are trying to run an HTML file as a PowerShell script.

    details-target btn-link d-lg-none mt-1 color-fg-inherit">

    This string referenced in the error message has nothing to do with the WSUS script, but is part of the GitHub page.

    exel2000 commented 2 years ago

    That's weird, I don't understand how that's possible when I am running a powershell script? Anyway, I downloaded it again using your links and I think I am closer now. Now I get the following error message:

    .\Optimize-WsusServer.ps1 : The script 'Optimize-WsusServer.ps1' cannot be run because the following modules that are specified by the "#requires" statements of the script are missing: SqlServer. At line:1 char:1

    exel2000 commented 2 years ago

    Ok, I think at least part of my issue here is that I'm trying this on PS 5.1 and PS 7. I guess I need version 6? It ran partially in PS 7 after I installed the sql module but I got all kinds of red text complaining about all kinds of things. I do start getting prompts asking me if I want to perform certain functions but most of them seem to fail. I am 100% it's me doing something wrong, but still struggling to get this working. Is there a reliable link where i can get PS 6? everything seems to want me to use version 7. Thanks for the help!