I am trying to fire a filesearch from Autoit via powershell to an already created line.
This is the full run command ( https://www.autoitscript.com/autoit3/docs/functions/Run.htm ) I am trying to go with :
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command Get-ChildItem -File D:\__Temp\123\2 - Copy -Recurse -Filter *.dcm | ForEach-Object { '<image>' + $_.FullName + '</image>' } | Out-File -FilePath D:\Temp\scan.txt -Append -Encoding UTF8
I already tried to use several " or ' around the path but nothing seemed to work and the shell just exits instantly without the filewrite.
Here's what I've tried:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command Get-ChildItem -File 'D:\__Temp\123\2 - Copy' -Recurse -Filter *.dcm | ForEach-Object { '<image>' + $_.FullName + '</image>' } | Out-File -FilePath D:\Temp\scan.txt -Append -Encoding UTF8
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -Command Get-ChildItem -File "D:\__Temp\123\2 - Copy" -Recurse -Filter *.dcm | ForEach-Object { '<image>' + $_.FullName + '</image>' } | Out-File -FilePath D:\Temp\scan.txt -Append -Encoding UTF8