Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
PsCmd2 and powershell ISE Different results
#1
Hi,

The following code execution results are different from those in Powershell ISE. I have encountered similar situations before. Are there any good solutions? 

Thank you in advance for any suggestions and help
David

powershell ise result:
TIM was found at C:\Program Files\LibreAutomate
TIM was not found at C:\Program Files (x86)\LibreAutomate

PsCmd2 result:
TIM was not found at C:\Program Files (x86)\LibreAutomate
TIM was not found at C:\Program Files (x86)\LibreAutomate



Macro Macro10
Code:
Copy      Help
_s=
;$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"
;,}
;}
PsCmd2 _s "" _s
out _s


Messages In This Thread
PsCmd2 and powershell ISE Different results - by Davider - 06-07-2023, 04:39 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)