Can get powershell script to work on button

        ps.AddScript($"$options = New-PSSessionOption -SkipCACheck -SkipCNCheck ; Invoke-Command -ComputerName {computer} -SessionOption $options -ScriptBlock {{ param($arg1, $arg2, $arg3, arg4) & 'C:\\Program Files (x86)\\Home Control\\HarmonyHubControl.exe' $arg1 $arg2 $arg3 $arg4 }} -ArgumentList {ip}, {command}, {commandId}, {label}");

Severity Code Description Project File Line Suppression State Error CS1061 'object' does not contain a definition for 'Invoke' and no extension method 'Invoke' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?) Home Control D:\localdoc\Visual Studio 2015\Projects\Home Control 2 (template)\Home Control\Form1.cs 230 Active Error CS1061 'object' does not contain a definition for 'AddScript' and no extension method 'AddScript' accepting a first argument of type 'object' could be found (are you missing a using directive or an assembly reference?) Home Control D:\localdoc\Visual Studio 2015\Projects\Home Control 2 (template)\Home Control\Form1.cs 229 Active Error CS0103 The name 'computer' does not exist in the current context Home Control D:\localdoc\Visual Studio 2015\Projects\Home Control 2 (template)\Home Control\Form1.cs 229 Active Error CS0103 The name 'ip' does not exist in the current context Home Control D:\localdoc\Visual Studio 2015\Projects\Home Control 2 (template)\Home Control\Form1.cs 229 Active Error CS0103 The name 'command' does not exist in the current context Home Control D:\localdoc\Visual Studio 2015\Projects\Home Control 2 (template)\Home Control\Form1.cs 229 Active Error CS0103 The name 'commandId' does not exist in the current context Home Control D:\localdoc\Visual Studio 2015\Projects\Home Control 2 (template)\Home Control\Form1.cs 229 Active Error CS0103 The name 'label' does not exist in the current context Home Control D:\localdoc\Visual Studio 2015\Projects\Home Control 2 (template)\Home Control\Form1.cs 229 Active

/r/csharp Thread Parent