I am developing a windows 8.1 store app and in that i want to get the GAL and add the GAL by using power shell script. When i tried to add the referance to System.Security.SecurityString it is giving an errors like follows.. I am trying to authenticate to with my office365 admin details but it is giving an error while building the app.
'System.Management.Automation.PSCredential' does not contain a constructor that takes 2 arguments
But it contains a constructor with two arguments , The same code works well when i build a windows forms application. What will be the wrong with windows 8.1 app?
System.Uri psURL = new Uri("https://ps.outlook.com/powershell/");
System.Security.SecureString securePassword1 = safeString("test");
System.Management.Automation.PSCredential creds1 = new System.Management.Automation.PSCredential("test", securePassword1);
Questions
1) Is System.Security.SecurityString is compatible with windows 8.1 app or this error coming from PSCredential why because when i removed the securestring referance the PSCredential error not happening but getting securestring error missing like that?
2) Is there any alternative method to connect to powershell without secure string by c# code?