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

This topic contains 2 replies, has 2 voices, and was last updated by

 
Participant
2 weeks, 2 days ago.

  • 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: 1085
    Points: 3,651
    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

You must be logged in to reply to this topic.