title: Running a psm1 PowerShell script in Command Prompt (cmd.exe)?
body: <p>I know nothing of PowerShell, but I wanted to install this: <a href="https://www.powershellgallery.com/packages/lolcat/" rel="nofollow noreferrer">https://www.powershellgallery.com/packages/lolcat/</a></p>
  <p>So, I start PowerShell as administrator, and:</p>
  <pre><code>PS C:\WINDOWS\system32&gt; Install-Module -Name lolcat                                                                                                                                                                                             NuGet provider is required to continue
  PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet
   provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or
  'C:\Users\Me\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by running
  'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install and import
   the NuGet provider now?
  [Y] Yes  [N] No  [S] Suspend  [?] Help (default is &quot;Y&quot;): y
  
  Untrusted repository
  You are installing the modules from an untrusted repository. If you trust this repository, change its
  InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
  'PSGallery'?
  [Y] Yes  [A] Yes to All  [N] No  [L] No to All  [S] Suspend  [?] Help (default is &quot;N&quot;): y
  PS C:\WINDOWS\system32&gt; lolcat
  
  Usage: lolcat [OPTION]... [FILE1[, FILE2[, ...]]]
  ...
  </code></pre>
  <p>Nice, it works. So first I find where is the newly installed script:</p>
  <pre><code>PS C:\WINDOWS\system32&gt; (Get-Module lolcat).Path
  C:\Program Files\WindowsPowerShell\Modules\lolcat\1.0.7\lolcat.psm1
  </code></pre>
  <p>Ok, so now I want to try calling this from cmd.exe:</p>
  <pre><code>C:\Users&gt;PowerShell.exe -File &quot;C:\Program Files\WindowsPowerShell\Modules\lolcat\1.0.7\lolcat.psm1&quot;
  Processing -File 'C:\Program Files\WindowsPowerShell\Modules\lolcat\1.0.7\lolcat.psm1' failed because the file does not have a '.ps1' extension. Specify a valid Windows PowerShell script file name, and then try again.
  Windows PowerShell
  Copyright (C) Microsoft Corporation. All rights reserved.
  
  Try the new cross-platform PowerShell https://aka.ms/pscore6
  </code></pre>
  <p>Nope, does not work.</p>
  <p>Is it possible to call this PowerShell script from cmd.exe - and if so, how?</p>