Below is a sample.
The following is code that had no problem until version 2.17, but cannot be pasted in version 2.18.
Scripting.RunPowershellScript Script: $'''#Power Automate for desktopのバージョンを取得
#※ストアアプリ版とインストーラー版の両方がインストールされている場合については考慮していません。
$padConsoleProcess = Get-Process -Name \"PAD.Console.Host\" -ErrorAction SilentlyContinue
if($padConsoleProcess){
$padConsolePath = $padConsoleProcess.Path
if($padConsolePath -like \"*WindowsApps*\"){
#ストアアプリ版
#「PAD.Console.Host.exe」のプロパティからバージョン情報を取得
$padVersion = (Get-ItemProperty $padConsolePath).VersionInfo.ProductVersion
}else{
#インストーラー版
#レジストリのUninstallキー以下からバージョン情報を取得
$padVersion = (Get-ChildItem -Path (\"HKLM:SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\", \"HKLM:SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\") | ForEach-Object {Get-ItemProperty $_.PsPath} | Where-Object {($_.DisplayName -eq \"Power Automate for desktop\") -and ($_.BundleVersion -ne $NULL)}).BundleVersion
}
Write-Output $padVersion
}''' ScriptOutput=> PowershellOutput ScriptError=> ScriptError
SET PadVersion TO PowershellOutput.Trimmed
The following is a code that can be pasted without any problem in version 2.18.
Scripting.RunPowershellScript Script: $'''#Power Automate for desktopのバージョンを取得
#※ストアアプリ版とインストーラー版の両方がインストールされている場合については考慮していません。
$padConsoleProcess = Get-Process -Name \"PAD.Console.Host\" -ErrorAction SilentlyContinue
if($padConsoleProcess){
$padConsolePath = $padConsoleProcess.Path
if($padConsolePath -like \"*WindowsApps*\"){
#ストアアプリ版
#「PAD.Console.Host.exe」のプロパティからバージョン情報を取得
$padVersion = (Get-ItemProperty $padConsolePath).VersionInfo.ProductVersion
}else{
#インストーラー版
#レジストリのUninstallキー以下からバージョン情報を取得
$padVersion = (Get-ChildItem -Path (\"HKLM:SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\", \"HKLM:SOFTWARE\\WOW6432Node\\Microsoft\\Windows\\CurrentVersion\\Uninstall\") | ForEach-Object {Get-ItemProperty $_.PsPath} | Where-Object {($_.DisplayName -eq \"Power Automate for desktop\") -and ($_.BundleVersion -ne $NULL)}).BundleVersion
}
Write-Output $padVersion
}''' ScriptOutput=> PowershellOutput ScriptError=> ScriptError
SET PadVersion TO PowershellOutput.Trimmed
# [ControlRepository][PowerAutomateDesktop]
{
"ControlRepositorySymbols": [],
"ImageRepositorySymbol": {
"Name": "imgrepo",
"ImportMetadata": {},
"Repository": "{\r\n \"Folders\": [],\r\n \"Images\": [],\r\n \"Version\": 1\r\n}"
}
}