Script Resource

Hi,

So I have been having an issue executing a script within a remote session. I’ve posted this on the other channel but can’t get it working. So thinking it might not be possible. So im hoping i can find a work around by use DSC.

I have a ps1 that triggers a SQL restore, i want to execute this script via the script resource in DSC, but i stuggling to understand the get-script,test-script set-script

Script ScriptExample
{
SetScript = {
$password = ConvertTo-SecureString "" -AsPlainText -Force
$Cred = New-Object System.Management.Automation.PSCredential ('
’, $password)
Start-Sleep -Seconds 15
Start-Job -Credential $Cred -ScriptBlock { C:\WindowsAzure*
*******\RestoreDB.ps1 }
}
TestScript = { Test-Path “C:\TempFolder\TestFile.txt” }
GetScript = { @{ Result = (Get-Content C:\TempFolder\TestFile.txt) } }
}

 

which is that thread in other channel, DSC wont be a good workaround here.