Code: Select all
Configuration update-settings
{
$hostname = $env:COMPUTERNAME
Node $hostname
{
Script whatever
{
GetScript = { return @{'Result' = 'something'} }
TestScript = { return $false }
# problem is here:
SetScript = { run-myfunction -args something }
}
}
}
Code: Select all
PowerShell DSC resource MSFT_ScriptResource failed to execute Set-TargetResource functionality with error message: The term 'run-myfunction' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a
path was included, verify that the path is correct and try again.
+ CategoryInfo : InvalidOperation: (:) [], CimException
+ FullyQualifiedErrorId : ProviderOperationExecutionFailure
+ PSComputerName : DESKTOPofMe
The SendConfigurationApply function did not succeed.
+ CategoryInfo : NotSpecified: (root/Microsoft/...gurationManager:String) [], CimException
+ FullyQualifiedErrorId : MI RESULT 1
+ PSComputerName : DESKTOPofMe
Are we essentially unable to refer to any external functions from the script blocks in a dsc? if so, how would I do this without having to copy and paste a bunch of repeated code?