Hi, I wanted to know if anything changes with regards to curly brackets “{“ when using ActionScript and PowerShell.
Our environment is running 11.0.5.x (Backend) and clients are 11.0.3.x (in process of upgrading all clients to 11.0.5.x in the coming weeks)
I’ve got small PowerShell script that gets created on the fly inside BigFix Action Script
delete __CreateFile
delete TestScript.ps1createfile until _endscript
function Log {
param (
[string]$sText
)$scriptName = "TestScript.log" $logFolderPath = "C:\HP\Logs\" $logFilePath = Join-Path -Path $logFolderPath -ChildPath $scriptName if (-not (Test-Path -Path $logFolderPath)) { New-Item -Path $logFolderPath -ItemType Directory } $sCurTime = Get-Date -Format "MM/dd/yyyy HH:mm:ss" $logEntry = "[$sCurTime - $scriptName] $sText" Add-Content -Path $logFilePath -Value $logEntry -ErrorAction SilentlyContinue}
Log "Start Script"
Log "End Script"
_endscript
move __CreateFile TestScript.ps1
action uses wow64 redirection false
waithidden Powershell.exe -NonInteractive -ExecutionPolicy Bypass -File TestScript.ps1
Question I have is around the “{“ I remember in the past that if you wanted to use this in PowerShell script you needed to use “{{“ if you did not want the script to treat it as “relevance”
When testing the above script as-is, it works just fine, it write content to log file without any issues.
I’ve updated the script and also used “{{“ and same result that also works fine, even when I look at the actual PowerShell script in both cases I only see “{“ and script works without any issues.
I’ve tested this both in FixletDebugger and also in actual action script targeted to test machine
Question? Does anyone know if the requirement for “{{“ when creating PowerShell script on the fly in action script is not needed anymore?
Thx!