Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PsCmd2 and powershell ISE Different results
#7
thank you!
LA runs well
Code:
Copy      Help
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);


Messages In This Thread
RE: PsCmd2 and powershell ISE Different results - by Davider - 06-08-2023, 09:03 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)