I am calling a batch file via c# using powershell library, I see the below error
'jss' is not recognized as an internal or external command,
Whereas manually executing the batch file runs with no issues.
c#
using (PowerShell powershell = PowerShell.Create())
{
powershell.AddCommand("c:\\test.bat", true);
Collection<PSObject> results = powershell.Invoke();
PSDataCollection<ErrorRecord> error = powershell.Streams.Error;
if (error.Count > 0)
{
for (int i = 0; i < error.Count; i++)
{
}
}
}
Batch file
cd C:\Projects\FirstJss
jss deploy app --includeContent --includeDictionary --acceptCertificate