public void Generate([NotNull] string targetFolder, out string idSecret, out string idCertificate, out string idCertificatePassword ) { Assert.ArgumentNotNull(targetFolder, "targetFolder"); string scriptFile = Path.Combine(Directory.GetCurrentDirectory(), "ContainerFiles/scripts/IdentityServerScript.txt"); PSFileExecutor ps = new PSFileExecutor(scriptFile, Path.GetDirectoryName(targetFolder)); Collection <PSObject> results = ps.Execute(); if (results.Count < 3) { throw new InvalidOperationException("Error in: IdentityServerVariablesGenerator. PS script has returned less than 3 results."); } idSecret = results[0].ToString(); idCertificate = results[1].ToString(); idCertificatePassword = results[2].ToString(); Assert.ArgumentNotNullOrEmpty(idSecret, "idSecret"); Assert.ArgumentNotNullOrEmpty(idCertificate, "idCertificate"); Assert.ArgumentNotNullOrEmpty(idCertificatePassword, "idCertificatePassword"); }
public string Convert(string licenseFilePath) { string scriptfile = Path.Combine(Directory.GetCurrentDirectory(), "ContainerFiles/scripts/LicenseScript.txt"); PSFileExecutor ps = new PSFileExecutor(scriptfile, Path.GetDirectoryName(licenseFilePath)); Collection <PSObject> results = ps.Execute(); return(results[0].ToString()); }
public string Generate() { string scriptFile = Path.Combine(Directory.GetCurrentDirectory(), "ContainerFiles/scripts/TelerikKeyGeneratorScript.txt"); PSFileExecutor ps = new PSFileExecutor(scriptFile, Directory.GetCurrentDirectory()); Collection <PSObject> results = ps.Execute(); if (results.Count < 1) { throw new InvalidOperationException("Error in: TelerikKeyGenerator. PS script has returned less than 1 result."); } return(results[0].ToString()); }