Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Access Parameter in SetScript member of Script Resource in Desired State Config

$
0
0

Hello,

Desired State Configuration….

I have been stuck in Script Resource where i need a Configuration Parameter to be used in member SetScript. Here is what i need to do….

Configuration MyConfig

{

param($MyComputerName)

Script MyScript

{

Write-Verbose "Computer Name is : $MyComputerName"
}

GetScript = {}

TestScript = {}

}

while executing above configuration, we are getting null value in $MyComputerName in SetScript. here, are the commands that i have been used.

MyConfig -MyComputerName localhost

Start-DscConfiguration -Wait -Verbose -Path ./MyConfig


Viewing all articles
Browse latest Browse all 13067

Trending Articles