From f675217508950156e1c3939c35df3b18e4930d13 Mon Sep 17 00:00:00 2001 From: Mike Griese Date: Fri, 15 Nov 2024 08:44:29 -0600 Subject: [PATCH] Add a helper to sanity check extension installs --- src/modules/cmdpal/check-extensions.ps1 | 33 +++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 src/modules/cmdpal/check-extensions.ps1 diff --git a/src/modules/cmdpal/check-extensions.ps1 b/src/modules/cmdpal/check-extensions.ps1 new file mode 100644 index 0000000000..ce15faea8c --- /dev/null +++ b/src/modules/cmdpal/check-extensions.ps1 @@ -0,0 +1,33 @@ +# Use me to check if extensions deployed correctly + +$gitRoot = git rev-parse --show-toplevel +Write-output "Checking repo root at $gitroot" +$extensionsRoot = "$gitroot\x64\Debug\WinUI3Apps\CmdPalExtensions" +Get-ChildItem -Path $extensionsRoot | ForEach-Object { + $extensionName = $_.Name + $extensionName + $extensionAppx = $_.PsPath + "\Appx" + if ((Test-Path $extensionAppx) -eq $false) { + Write-Host " `e[31;1mUNEXPECTED`e[0m: There was no Appx/ directory. Make sure you deploy the package!" + } + else + { + # Write-Host "`e[90m Found Appx/ directory`e[0m" + $appxWinmd = $extensionAppx + "\Microsoft.CmdPal.Extensions.winmd" + if ((Test-Path $appxWinmd) -eq $false) { + Write-Host " `e[31;1mUNEXPECTED`e[0m: Did not find Microsoft.CmdPal.Extensions.winmd" + } + else { + # Write-Host "`e[90m Found the winmd`e[0m" + Write-Host "`e[92m Everything looks good`e[0m" + } + } +} +$winmdRoot = "$gitroot\\x64\Debug\Microsoft.CmdPal.Extensions" +$winmdOutput = "$winmdRoot\Microsoft.CmdPal.Extensions.winmd" +if ((Test-Path $appxWinmd)) { + Write-Host "Found Microsoft.CmdPal.Extensions.winmd where it's supposed to be" +} +else { + Write-Host " `e[31;1mUNEXPECTED`e[0m: Did not find Microsoft.CmdPal.Extensions.winmd where it's supposed to be built! Did you build Microsoft.CmdPal.Extensions?" +} \ No newline at end of file