Unable to pass local parameter to ps-session using scriptBlock and start-process

Welcome Forums General PowerShell Q&A Unable to pass local parameter to ps-session using scriptBlock and start-process

Viewing 2 reply threads
  • Author
    Posts
    • #260931
      Participant
      Topics: 1
      Replies: 1
      Points: 18
      Rank: Member

      I have been working on getting this to work for a least a week. Searched and tried numerous suggestions…nothing is working..

      My goal is to start a remote wusa process to install a windows patch. This computer doesn’t have Internet access…nor can it. I don’t need a full blown WSUS installation. I only have 5 computers to patch. Though I do welcome feedback and suggestions.

      Here is the code I am trying to get working:

      And some debug from the ISE:

      I really thought the most recent iteration (above) would work. I seems to follow Microsoft’s documentation about remote execution…but doesn’t. The “wusa” process starts on the remote computer. but it is clear the parameter doesn’t get set and passed.

      Any help or insight to find out how I can get this working is appreciated.

      ~~ Curtis

      • This topic was modified 3 weeks ago by grokkit. Reason: code formatting - please read the guide
    • #260982
      Senior Moderator
      Topics: 9
      Replies: 1373
      Points: 5,061
      Helping Hand
      Rank: Community MVP

      looks like the code is not properly formatted. Can you create a gist (gist.github.com) and share the link here ?

    • #263001
      Participant
      Topics: 1
      Replies: 1
      Points: 18
      Rank: Member

      Ok. Here is the gist.

      https://gist.github.com/croze65/977a3acee97e1b8367407df90f21896a

      • This reply was modified 1 week, 5 days ago by kvprasoon. Reason: Render gist properly
      • This reply was modified 1 week, 5 days ago by kvprasoon.
      • This reply was modified 1 week, 5 days ago by kvprasoon.
Viewing 2 reply threads
  • You must be logged in to reply to this topic.