06-08-2023, 09:03 AM
thank you!
LA runs well
LA runs well
string code1 = """
[console]::OutputEncoding = [System.Text.Encoding]::Unicode
$programFiles = [Environment]::GetFolderPath("ProgramFiles")
$programFilesx86 = [Environment]::GetFolderPath("ProgramFilesX86")
$searchPaths = @("$programFiles\LibreAutomate", "$programFilesx86\LibreAutomate")
foreach ($searchPath in $searchPaths)
{
if (Test-Path "$searchPath\Au.Editor.exe")
{
write-output "TIM was found at $searchPath"
}
else
{
write-output "TIM was not found at $searchPath"
}
}
""";
string file1 = folders.ThisAppTemp + "PowerShell.ps1";
filesystem.saveText(file1, code1, encoding: Encoding.Unicode);
run.console("PowerShell.exe", $"-ExecutionPolicy Bypass -File \"{file1}\"", encoding: Encoding.Unicode);