How to use private data as a powershell script parameter

Post Reply
netaware
Member
Posts: 37
Joined: Tue Jul 30, 2024 7:11 pm

How to use private data as a powershell script parameter

Post by netaware »

Hello,
I am using a Powershell script to send me an email. I am not using the Email element because i want to attach a specific file to it and i can do it with PS easily.
It seems like Switch is not expanding the the private data correctly and i dont know why.
This is how i am testing:
Execute Command element
Command or path : C:/Windows/System32/WindowsPowerShell/v1.0/powershell.exe
Arguments : -Command "Write-Output "[Job.Name]" > D:\temp\debug.txt"

But when i look at the debug.txt file, all i see is [Job.Name]

Any ideas?
User avatar
magnussandstrom
Advanced member
Posts: 579
Joined: Thu Jul 30, 2020 6:34 pm
Location: Sweden
Contact:

Re: How to use private data as a powershell script parameter

Post by magnussandstrom »

Maybe you have selected Inline value instead of Define single-line text with variables in Arguments?

If no success maybe you can use the app Run Command instead to see if that solves your issue?
netaware
Member
Posts: 37
Joined: Tue Jul 30, 2024 7:11 pm

Re: How to use private data as a powershell script parameter

Post by netaware »

Wow that was it!
I was using inline value
i switched to Define single-line text with variables and it worked!

Thank you, thank you
Post Reply