Important Notice: On February 29th, this community was put into read-only mode. All existing posts will remain but customers are unable to add new posts or comment on existing. Please feel to join our Community Discord for any questions and discussions.

Passing a parameter to a Powershell Script

Evening,

I'm trying to deploy a powershell script that needs a parameter. I'm having trouble getting it to accept the parameter. Could someone tell me where to put the parameter? Here is what I have so far. I need to add the parameter -Basic

Thanks

Gareth

enter image description here

0

Comments

3 comments
Date Votes
  • 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
  • I recommend using an Install step. It has a Parameters field.

    0
  • 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