PowerShell DSC Variables Getting Null after Invoke-Command execute from pwrshell

Welcome Forums DSC (Desired State Configuration) PowerShell DSC Variables Getting Null after Invoke-Command execute from pwrshell

Viewing 1 reply thread
  • Author
    Posts
    • #180905
      Participant
      Topics: 1
      Replies: 1
      Points: -5
      Rank: Member

      Configuration setupfilezip
      {
      param
      ($ComputerName)
      $vdirectoryPath
      = "C:\temp\setupfiles"
      Import-DscResource -ModuleName "PSDesiredStateConfiguration"
      Node 'localhost'{
      File setupfiles {
      Type = 'Directory'
      DestinationPath = $vdirectoryPath
      Ensure = "Present"
      }
      }
      }
      setupfilezip

      Start-DscConfiguration -ComputerName localhost -Path setupfilezip -Wait -Verbose

      ///another powershell script

      Invoke-Command "C:\tmp\sample2.ps1"

    • #180983
      Senior Moderator
      Topics: 8
      Replies: 1155
      Points: 4,019
      Helping Hand
      Rank: Community Hero

      It'll be good if you can give us need more information,

      Which variable is getting null here ?
      What is the flow of execution ? (which script gets triggered first)

      • #181043
        Participant
        Topics: 1
        Replies: 1
        Points: -5
        Rank: Member

        its a single script

Viewing 1 reply thread
  • The topic ‘PowerShell DSC Variables Getting Null after Invoke-Command execute from pwrshell’ is closed to new replies.