Skip to content

Instantly share code, notes, and snippets.

@kinuasa
Last active July 26, 2022 07:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kinuasa/154edc702a93311352179a9375164492 to your computer and use it in GitHub Desktop.
Save kinuasa/154edc702a93311352179a9375164492 to your computer and use it in GitHub Desktop.
Power Automate for desktopのバージョンを確認するPowerShellスクリプト 関連記事:https://www.ka-net.org/blog/?p=14342
@echo off
cd /d %~dp0
PowerShell -NoProfile -ExecutionPolicy Unrestricted .\CheckPADVersion.ps1
# Power Automate for desktopのバージョンを確認するPowerShellスクリプト
$padInstVersion = (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
$padAppxPackage = Get-AppxPackage | Where-Object {$_.Name.ToString() -Like "*PowerAutomate*"}
if($padAppxPackage){
$padStoreConsolePath = Join-Path $padAppxPackage.InstallLocation "PAD.Console.Host.exe"
if(Test-Path $padStoreConsolePath){
$padStoreVersion = (Get-ItemProperty $padStoreConsolePath).VersionInfo.ProductVersion
}
}
Add-Type -AssemblyName "System.Windows.Forms"
[System.Windows.Forms.MessageBox]::Show("インストーラー版:$padInstVersion`r`nストアアプリ版:$padStoreVersion")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment