I have created a low-code tools DA that is set to run a snippet of powershell. It is a multi-line powershell script that has been tested on a live server and returns the results we’re looking for, however it seems to break when I put it into the low-code snippet window.
It seems to be erroring out due to syntax of the script, I’m wondering if there is a way to enter a multi-line script into low-code tools that I am missing? (for a similar example, in curl you surround a multi-line script in 3 quotes)
Here’s an example of the beginning of the script:
low_code:
version: 2
steps:
- powershell:
command: $Domain = "#####"
$Limit = 120
try {
# Find one Domain Controller
$DC = (Resolve-DnsName "_ldap._tcp.dc._msdcs.$Domain" -Type SRV -ErrorAction Stop |
Select-Object -First 1 -ExpandProperty NameTarget).TrimEnd('.')