-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppxBackup.psd1
More file actions
243 lines (200 loc) · 8.93 KB
/
AppxBackup.psd1
File metadata and controls
243 lines (200 loc) · 8.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
@{
# Script module or binary module file associated with this manifest.
RootModule = 'AppxBackup.psm1'
# Version number of this module.
ModuleVersion = '2.0.2'
# Supported PSEditions
CompatiblePSEditions = @('Desktop', 'Core')
# ID used to uniquely identify this module
GUID = 'a3f2c8d1-9b4e-4a7c-8f6d-2e1b9c4a7f3e'
# Author of this module
Author = 'DeltaGa'
# Company or vendor of this module
CompanyName = 'DeltaGa Systems Engineering'
# Copyright statement for this module
Copyright = '(c) DeltaGa. All rights reserved.'
# Description of the functionality provided by this module
Description = @'
Enterprise-grade Windows Application Package (APPX/MSIX) backup and restoration toolkit.
This module provides comprehensive functionality for:
- Backing up installed Windows Store/MSIX applications to portable packages
- Creating ZIP-based dependency packages (.appxpack) with orchestrated installation
- Managing certificates with modern security practices
- Handling dependencies, resources, and multi-architecture packages
- Validating package integrity and compatibility
- Automated rollback and error recovery
Replaces 2016-era tooling with modern PowerShell 7+ native capabilities
while maintaining backward compatibility with Windows 10/11 APPX infrastructure.
Key Features:
[CHECK] Comprehensive error handling and logging
[CHECK] Pipeline support for batch operations
[CHECK] Progress indication for long-running operations
[CHECK] Secure certificate management with HSM support
[CHECK] MSIX sparse package support
[CHECK] ZIP-based dependency packaging with installation orchestration
[CHECK] Extensive validation and compatibility checking
'@
# Minimum version of the PowerShell engine required by this module
PowerShellVersion = '7.4'
# Minimum version of the common language runtime (CLR) required by this module
# CLRVersion = '4.0'
# Processor architecture (None, X86, Amd64) required by this module
ProcessorArchitecture = 'None'
# Modules that must be imported into the global environment prior to importing this module
RequiredModules = @()
# Assemblies that must be loaded prior to importing this module
RequiredAssemblies = @()
# Script files (.ps1) that are run in the caller's environment prior to importing this module.
ScriptsToProcess = @()
# Type files (.ps1xml) to be loaded when importing this module
TypesToProcess = @()
# Format files (.ps1xml) to be loaded when importing this module
FormatsToProcess = @()
# Modules to import as nested modules of the module specified in RootModule/ModuleToProcess
NestedModules = @()
# Functions to export from this module, for best performance, do not use wildcards and do not delete the entry
FunctionsToExport = @(
'Backup-AppxPackage',
'Install-AppxBackup',
'New-AppxBackupCertificate',
'Test-AppxPackageIntegrity',
'Get-AppxBackupInfo',
'Export-AppxDependencies',
'Get-AppxToolPath',
'Test-AppxBackupCompatibility'
)
# Cmdlets to export from this module, for best performance, do not use wildcards and do not delete the entry
CmdletsToExport = @()
# Variables to export from this module
VariablesToExport = @()
# Aliases to export from this module, for best performance, do not use wildcards and do not delete the entry
AliasesToExport = @(
'Backup-AppX',
'Export-AppX',
'Save-AppxPackage',
'Restore-AppxPackage'
)
# DSC resources to export from this module
DscResourcesToExport = @()
# List of all modules packaged with this module
ModuleList = @()
# List of all files packaged with this module
FileList = @(
'AppxBackup.psd1',
'AppxBackup.psm1',
'Public\Backup-AppxPackage.ps1',
'Public\Install-AppxBackup.ps1',
'Public\New-AppxBackupCertificate.ps1',
'Public\Test-AppxPackageIntegrity.ps1',
'Public\Get-AppxBackupInfo.ps1',
'Public\Export-AppxDependencies.ps1',
'Public\Get-AppxToolPath.ps1',
'Public\Test-AppxBackupCompatibility.ps1',
'Private\Invoke-ProcessSafely.ps1',
'Private\Write-AppxLog.ps1',
'Private\Get-AppxManifestData.ps1',
'Private\New-AppxPackageInternal.ps1',
'Private\Test-AppxToolAvailability.ps1',
'Private\Resolve-AppxDependencies.ps1',
'Private\ConvertTo-SecureFilePath.ps1',
'Private\Get-AppxConfiguration.ps1',
'Private\Get-AppxDefault.ps1',
'Private\New-AppxBackupZipArchive.ps1',
'Private\New-AppxBackupManifest.ps1',
'Private\New-AppxDependencyCertificate.ps1',
'Private\ConvertTo-HtmlEncodedString.ps1',
'Private\Copy-AppxSourceDirectory.ps1',
'Private\Find-AppxSdkTool.ps1',
'Private\Get-AppxMakeAppxErrorAnalysis.ps1',
'Private\Install-AppxCertificateToStore.ps1',
'Private\Invoke-AppxSignTool.ps1',
'Private\Remove-AppxItemWithRetry.ps1',
'Private\Resolve-AppxManifestNode.ps1',
'Private\Test-AppxArchitectureCompatibility.ps1',
'Private\Test-AppxDiskSpace.ps1',
'Private\Test-AppxPackagingPrerequisites.ps1',
'Config\ToolConfiguration.json',
'Config\WindowsReservedNames.json',
'Config\PackageConfiguration.json',
'Config\ModuleDefaults.json',
'Config\ZipPackagingConfiguration.json',
'Examples\UsageExamples.md',
'Test-AppxBackupModule.ps1'
)
# Private data to pass to the module specified in RootModule/ModuleToProcess
PrivateData = @{
PSData = @{
# Tags applied to this module for discoverability
Tags = @(
'Windows',
'APPX',
'MSIX',
'WindowsStore',
'Backup',
'Package',
'Certificate',
'UWP',
'Store',
'Application',
'Restore',
'Migration',
'WindowsPackage',
'AppxPackage',
'MsixPackage',
'Dependency'
)
# A URL to the license for this module.
LicenseUri = 'https://github.com/DeltaGa/AppxBackup.Module/blob/main/LICENSE'
# A URL to the main website for this project.
ProjectUri = 'https://github.com/DeltaGa/AppxBackup.Module'
# A URL to an icon representing this module.
IconUri = 'https://raw.githubusercontent.com/DeltaGa/AppxBackup.Module/main/Assets/icon.png'
# ReleaseNotes of this module
ReleaseNotes = @'
Version 2.0.2 (February 13, 2026)
=================================
RELEASE SUMMARY:
Code quality and maintainability improvements with 11 new private helper functions extracted from core logic.
Refactored Backup-AppxPackage and New-AppxPackageInternal removing ~600 lines of duplicate/embedded functionality.
Comprehensive test harness added for all 8 public functions with CI/CD integration support.
WHAT'S NEW:
Code Organization
- 11 new private helper functions (ConvertTo-HtmlEncodedString, Copy-AppxSourceDirectory, Find-AppxSdkTool, Get-AppxMakeAppxErrorAnalysis, Install-AppxCertificateToStore, Invoke-AppxSignTool, Remove-AppxItemWithRetry, Resolve-AppxManifestNode, Test-AppxArchitectureCompatibility, Test-AppxDiskSpace, Test-AppxPackagingPrerequisites)
- Refactored core functions by removing ~600 lines of duplicate logic
- Improved code testability and reusability
Directory Operations & Validation
- Three-tier fallback directory copying (Robocopy → Copy-Item → .NET APIs)
- Disk space validation with configurable thresholds
- System prerequisite checking (SDK tools, Windows version)
- CPU architecture compatibility validation
Certificate & Signing
- Certificate installation to Windows certificate stores
- Robust SignTool execution wrapper with error handling
- MakeAppx error message parsing and interpretation
Testing & Documentation
- Test-AppxBackupModule.ps1 comprehensive test harness for all 8 public functions
- Automatic app discovery and transcript logging
- Structured results with pass/fail/skip/error tracking for CI/CD
- Expanded UsageExamples.md with detailed examples for all functions
- Updated README with Private Functions reference section
COMPATIBILITY:
- Windows 10 1809+ (all editions)
- Windows 11 (all versions)
- Windows Server 2019+
- PowerShell 7.4+
- MSIX Packaging Tool compatible
- Legacy APPX fully supported
'@
# Prerelease string of this module
Prerelease = ''
# Flag to indicate whether the module requires explicit user acceptance for install/update/save
RequireLicenseAcceptance = $false
# External dependent modules of this module
ExternalModuleDependencies = @()
}
}
# HelpInfo URI of this module
HelpInfoURI = ''
# Default prefix for commands exported from this module
DefaultCommandPrefix = ''
}