title: How I can execute extern Module Commands on a remote Computer in Powershell without install the Module?
body: <p>I want to execute powershell commands on a remote computer and I use a extern Module on the localhost. I tested it and get the message that I don't can use the command on the remote computer but locally it works. </p>
  
  <p>So I have installed the module on the remote computer via Import-Module and it works. </p>
  
  <p>But this is bad and I want not install the module on every computer in the company. </p>
  
  <p><strong>Here is my PS Script:</strong> </p>
  
  <pre><code>$cred = Get-Credential
  
  $isConnect = Test-WSMan edv-004
  
  if($isConnect){
  
      #Get-WUHistory is from a extern Module and list the Updatehistory of a computer
      Invoke-Command -ComputerName edv-004 -ScriptBlock { Get-WUHistory } -Credential $cred
  
      Write-Host "Skript wurde auf ausgeführt..."
  }
  </code></pre>
  
  <p>Before I run this script I have do this: </p>
  
  <pre><code>Enable-PSRemoting -Force
  Set-Item WSMan:\localhost\Client\TrustedHosts * -Force  #for testing 
  Restart-Service WinRM
  </code></pre>
  
  <p>So how I can execute extern module commands without install it on the remote computer? :/ </p>