Hello
I have a piece of code that runs fine in Powershell (Azure automation runbook) but when I transplant this into a class method/function I get an error about "Variable is not assigned in the method."
The code returns a DataSet from SQL server
e.g.
$DS = ($Helper.GetHTML(($Helper.ExcuteSQLProcs("EXEC [dbo].[usp_FirewallRuleCountChanged_Get] @DayAgo = 2")).Tables[0]))
works fine in inline code but in a method I get an error
[void] SendAlert([string] $To, [string] $Subject, [int] $DaysAgo )
{
$DS = ($Helper.GetHTML(($Helper.ExcuteSQLProcs("EXEC [dbo].[usp_FirewallRuleCountChanged_Get] @DayAgo = 2")).Tables[0]))
}
Variable is not assigned in the method.
Any ideas anyone?
Thanks