Pass parameters to script

Welcome Forums General PowerShell Q&A Pass parameters to script

Viewing 1 reply thread
  • Author
    • #210975
      Topics: 1
      Replies: 0
      Points: 13
      Rank: Member

      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 :





      I don’t know how to resolve this.

      Does some of you have a hint about it.

      Thank you very much

      Best regards


    • #210978
      Topics: 4
      Replies: 2247
      Points: 5,484
      Helping Hand
      Rank: Community MVP

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

      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!


Viewing 1 reply thread
  • You must be logged in to reply to this topic.