Pass parameters to script

Hello everyone,

I got 2 scripts, from the 1rst one I define some parameters and then I try to send then to the second one.

Script one :

$ToUpDate = “computer name”
$updateCategory = “Critical Updates”, “Definition Updates”, “Security Updates”

powershell “\someServerName\INFRA\WindowsUpdate\install-windowsupdates.ps1” -Computer $ToUpDate -Updatetype $updateCategory

 

Script two : Start with the following :

[CmdletBinding()]

Param(
[parameter(Mandatory=$true,Position=1)]
[string[]]$computer,

[parameter(Mandatory=$true,Position=2)]
[string[]]$Updatetype
)

 

I don’t know how to resolve this.

Does some of you have a hint about it.

Thank you very much

Best regards

Adrien

You should omit the “Powershell” in your command line you use in your 1st script. You are already running a Powershell console. :wink:

When you post code or sample data or console output you should format it as code using the code tags “PRE”. Read Me Before Posting! You’ll be Glad You Did!

Thanks