PowerShellEmpire/PowerTools

Errors when Importing into Powershell

malhovic opened this issue · 2 comments

When running powershell (both with powershell -exec bypass or just setting the execution policy to unrestricted) I'm getting the below errors in trying to run Import-Module:

Import-Module : The module manifest 'C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PowerView\PowerView.psd1'
could not be processed because it is not a valid Windows PowerShell restricted language file. Remove the elements that
are not permitted by the restricted language:
At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PowerView\PowerView.psd1:107 char:12

  •   <!-- </textarea> --><!-- '"` --><form accept-charset="UTF-8" action="/Powe ...
    
  •        ~
    
    The '<' operator is reserved for future use.
    At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PowerView\PowerView.psd1:840 char:203
  • ... hidden" value="✓" />
  •                ~
    
    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:\Windows\system32\WindowsPowerShell\v1.0\Modules\PowerView\PowerView.psd1:871 char:11
  •   <li>&copy; 2016 <span title="0.04437s from github-fe138-cp1-prd.iad.github ...
    
  •       ~
    
    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:\Windows\system32\WindowsPowerShell\v1.0\Modules\PowerView\PowerView.psd1:871 char:23
  •   <li>&copy; 2016 <span title="0.04437s from github-fe138-cp1-prd.iad.github ...
    
  •                   ~
    
    The '<' operator is reserved for future use.
    At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PowerView\PowerView.psd1:871 char:29
  •   <li>&copy; 2016 <span title="0.04437s from github-fe138-cp1-prd.iad.github ...
    
  •                         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
    Unexpected token 'title="0.04437s from github-fe138-cp1-prd.iad.github.net">GitHub' in expression or statement.
    At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PowerView\PowerView.psd1:871 char:100
  • ... ">GitHub, Inc.
  •                ~
    
    Missing argument in parameter list.
    At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PowerView\PowerView.psd1:904 char:83
  • ... tab or window. Reload to refresh your session.
  •                ~
    
    The '<' operator is reserved for future use.
    At C:\Windows\system32\WindowsPowerShell\v1.0\Modules\PowerView\PowerView.psd1:905 char:83
  • ... tab or window. Reload to refresh your session.
  •                ~
    
    The '<' operator is reserved for future use.
    At line:1 char:1
  • Import-Module PowerView
  • - CategoryInfo          : ResourceUnavailable: (C:\Windows\syst...\PowerView.psd1:String) [Import-Module], Missing
      MemberException
    - FullyQualifiedErrorId : Modules_InvalidManifest,Microsoft.PowerShell.Commands.ImportModuleCommand
    

I believe you have download the github html page and not the raw ps* files. You can download the zip archive and then extract it to a folder or if you want to download individual files then download the raw file such as https://raw.githubusercontent.com/PowerShellEmpire/PowerTools/master/PowerView/powerview.psd1

Yeah PowerShell won't execute HTML...