From ead94820acd03c277ab32a4959909f92cd261635 Mon Sep 17 00:00:00 2001 From: USER Date: Fri, 29 Aug 2025 16:12:28 +0100 Subject: [PATCH] . --- bin/SoftwareList.bat | 11 ++++------- bin/SoftwareList.ps1 | 43 +++++++++++++++++++++++++++++++++++++++++++ bin/fix_wordpad1.bat | 4 ++++ bin/fixchoco.bat | 4 ++++ 4 files changed, 55 insertions(+), 7 deletions(-) create mode 100755 bin/SoftwareList.ps1 diff --git a/bin/SoftwareList.bat b/bin/SoftwareList.bat index 27941f3..9fab56d 100755 --- a/bin/SoftwareList.bat +++ b/bin/SoftwareList.bat @@ -1,10 +1,7 @@ @echo off -set check_computername=%COMPUTERNAME% -echo "Found computer %check_computername%" - -set PACKAGES="C:\Packages" -set WPUBLIC="C:\wPublic" +call C:\Scripts\wBase\baseENV.bat +call C:\Scripts\wLocal\localENV.bat echo "Dump software list" -set PSFILE="%WPUBLIC%\bin\ListSoftware.ps1" -Powershell.exe -ExecutionPolicy Bypass -File %PSFILE% > "C:\%check_computername%.txt" +set PSFILE="%WBASE%\bin\SoftwareList.ps1" +%POWERSHELL% -ExecutionPolicy Bypass -File %PSFILE% > "C:\%check_computername%.txt" diff --git a/bin/SoftwareList.ps1 b/bin/SoftwareList.ps1 new file mode 100755 index 0000000..88adf82 --- /dev/null +++ b/bin/SoftwareList.ps1 @@ -0,0 +1,43 @@ +function listAumids( $userAccount ) { + + if ($userAccount -eq "allusers") + { + # Find installed packages for all accounts. Must be run as an administrator in order to use this option. + $installedapps = Get-AppxPackage -allusers + } + elseif ($userAccount) + { + # Find installed packages for the specified account. Must be run as an administrator in order to use this option. + $installedapps = get-AppxPackage -user $userAccount + } + else + { + # Find installed packages for the current account. + $installedapps = get-AppxPackage + } + + $aumidList = @() + foreach ($app in $installedapps) + { + foreach ($id in (Get-AppxPackageManifest $app).package.applications.application.id) + { + $aumidList += $app.packagefamilyname + "!" + $id + } + } + + return $aumidList +} + +# Get a list of AUMIDs for the current account: +listAumids + +# Get a list of AUMIDs for an account named “CustomerAccount”: +listAumids("CustomerAccount") + +# Get a list of AUMIDs for all accounts on the device: +listAumids("allusers") + +get-wmiobject Win32_Product | Format-Table IdentifyingNumber, Name, LocalPackage -AutoSize + + +Get-AppxPackage -allusers \ No newline at end of file diff --git a/bin/fix_wordpad1.bat b/bin/fix_wordpad1.bat index 1c23d35..30cedcd 100644 --- a/bin/fix_wordpad1.bat +++ b/bin/fix_wordpad1.bat @@ -1,3 +1,7 @@ +@echo off +call C:\Scripts\wBase\baseENV.bat +call C:\Scripts\wLocal\localENV.bat + xcopy "S:\WordPad\Windows NT\Accessories" "C:\Program Files\Windows NT\Accessories" /h /e diff --git a/bin/fixchoco.bat b/bin/fixchoco.bat index 7f78888..553d698 100644 --- a/bin/fixchoco.bat +++ b/bin/fixchoco.bat @@ -1 +1,5 @@ +@echo off +call C:\Scripts\wBase\baseENV.bat +call C:\Scripts\wLocal\localENV.bat + choco uninstall git notepadplusplus -y -force \ No newline at end of file