title: How to run a ps1 script with parameters inside PowerShell
body: <p>I have a script that is really basic, it checks to see if certain lister values are null and if they are they are to run a ps1 script in another location. I can get this to work just fine. The problem I have is there are parameters that I need to include when running the other script.</p>
  <pre><code>$winRM = Get-WSManInstance -ResourceURI winrm/config/listener -SelectorSet @{Address=&quot;*&quot;;Transport=&quot;https&quot;}
  $winRMPort = $winRM.Port
  $winRMTransport = $winRM.Transport
  $winRMThumbprint = $winRM.CertificateThumbprint
  if(($winRMPort -eq $null) -and ($winRMTransport -eq $null) -and ($winRMThumbprint -eq $null)){
      &amp; &quot;\\myLocation\Scripts\ConfigureRemotingForAnsible.ps1 #These parameters are the part in question -DisableBasicAuth -CertValidityDays 20 -ForceNewSSLCert&quot;
  }
  else{
      $false
  }
  </code></pre>
  <p>There are parameters in the other script that work just fine but when I run it in PowerShell it doesn't work.</p>
  <pre><code>Param (
      [string]$SubjectName = $env:COMPUTERNAME,
      [int]$CertValidityDays = 1095,
      [switch]$SkipNetworkProfileCheck,
      $CreateSelfSignedCert = $true,
      [switch]$ForceNewSSLCert,
      [switch]$GlobalHttpFirewallAccess,
      [switch]$DisableBasicAuth = $false,
      [switch]$EnableCredSSP
  )
  </code></pre>
  <p>I just need to know what I am doing wrong and how to actually pass these parameters without it having issues. Thank you in advance.</p>