Passing a parameter to a Powershell Script

Comments

3 comments

  • Brad McClave

    It looks like you are telling PDQ to run PowerShell via a .ps1 file. If I am understanding you correctly, you need to have the parameter in the .ps1 file or just copy the entire code into the details and setup the parameter there.

    0
    Comment actions Permalink
  • Colby Bouma

    I recommend using an Install step. It has a Parameters field.

    0
    Comment actions Permalink
  • maki

    my 5 cents... easier is to make Powershell Step than use that technet script... Or make multiple steps with different rsat tools and define parameters like IF member of this collection then install this step etc... if you have corp env you need disable temporarily wsus

    $currentWU = Get-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "UseWUServer" | select -ExpandProperty UseWUServer
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "UseWUServer" -Value 0
    Restart-Service wuauserv
    Get-WindowsCapability -Name RSAT* -Online | Add-WindowsCapability –Online
    Set-ItemProperty -Path "HKLM:\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU" -Name "UseWUServer" -Value $currentWU
    Restart-Service wuauserv
    

    enter image description here

    enter image description here

    0
    Comment actions Permalink

Please sign in to leave a comment.