Product: PowerShell Universal
Version: 4.1.1
Hi,
I was looking into automating the creating of scripts in PSU, but are struggling with getting the correct content into the script.
I have several .ps1 files in my Git folder, that i want to create the script from - and was hoping to use a command similar to this:
New-PSUScript -Name $ScriptName -Path "Databases\$($ScriptName).ps1" -ScriptBlock {$(Get-Content -Path $RunBookPS1Path -Encoding utf8)}
The script is created correctly, but the actual data of the script is “Get-Content -Path $RunBookPS1Path -Encoding utf8” instead of the content of the actual file.
How do i get the ScriptBlock parameter, to read my files and then insert the data?