Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
/Uninstall.psm1 -text
/MiniModules.Uninstall.psd1 text eol=lf
/Uninstall*.Tests.ps1 text eol=lf
/Uninstall.md text eol=lf
/LICENSE text eol=lf
/out/* text eol=lf
/out/Uninstall.psm1 -text
15 changes: 15 additions & 0 deletions .github/workflows/source-uninstall.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Uninstall source checks
on:
push:
branches: [prepare/uninstall-package]
pull_request:
branches: [Uninstall/develop]
permissions:
contents: read
jobs:
source:
uses: stadub/PowershellScripts/.github/workflows/validate-module-source.yml@42814913be33a4662a57dbf011333b96c5fa294f
with:
module: Uninstall
source_sha: ${{ github.event.pull_request.head.sha || github.sha }}
automation_sha: 42814913be33a4662a57dbf011333b96c5fa294f
20 changes: 20 additions & 0 deletions MiniModules.Uninstall.psd1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@{
RootModule = 'Uninstall.psm1'
ModuleVersion = '1.0.1'
GUID = '27c80b64-2c07-43ee-ae20-4d94965295eb'
Author = 'Dima Stadub'
Description = 'Windows application uninstall helper using the registry and msiexec. Importing the module does not uninstall applications.'
PowerShellVersion = '5.1'
FunctionsToExport = @('Uninstall-Application')
CmdletsToExport = @()
VariablesToExport = @()
AliasesToExport = @()
PrivateData = @{
PSData = @{
Tags = @('Windows', 'Uninstall', 'msiexec')
LicenseUri = 'https://github.com/stadub/PowershellScripts/blob/master/LICENSE'
ProjectUri = 'https://github.com/stadub/PowershellScripts'
ReleaseNotes = 'Prepare the existing standalone module for manifest-based packaging; uninstall implementation unchanged.'
}
}
}
29 changes: 29 additions & 0 deletions Uninstall.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
$manifest = Join-Path $PSScriptRoot 'MiniModules.Uninstall.psd1'
Describe 'Uninstall module packaging contracts' {
BeforeAll {
$script:loaded = Import-Module $manifest -Force -PassThru -ErrorAction Stop
}
AfterAll { Remove-Module $script:loaded -Force -ErrorAction SilentlyContinue }
It 'validates the manifest and unchanged public command' {
(Test-ModuleManifest $manifest).Version.ToString() | Should -BeExactly '1.0.1'
$script:loaded.Name | Should -BeExactly 'MiniModules.Uninstall'
(Import-PowerShellDataFile $manifest).RootModule | Should -BeExactly 'Uninstall.psm1'
$script:loaded.ExportedFunctions.Count | Should -Be 1
$script:loaded.ExportedFunctions.ContainsKey('Uninstall-Application') | Should -BeTrue
}
It 'preserves the mandatory pipeline software-name parameter and Application alias' {
$command = $script:loaded.ExportedFunctions['Uninstall-Application']
$parameter = $command.Parameters['SoftwareName']
$parameter.Aliases | Should -Contain 'Application'
$contract = @($parameter.Attributes | Where-Object { $_ -is [Management.Automation.ParameterAttribute] })[0]
$contract.Mandatory | Should -BeTrue
$contract.ValueFromPipeline | Should -BeTrue
}
It 'imports safely without starting an uninstaller or reading registry entries' {
Mock Start-Process { throw 'Unexpected uninstaller invocation' }
Mock Get-ItemProperty { throw 'Unexpected registry access' }
Import-Module $manifest -Force -ErrorAction Stop
Assert-MockCalled Start-Process 0 -Exactly -Scope It
Assert-MockCalled Get-ItemProperty 0 -Exactly -Scope It
}
}
16 changes: 16 additions & 0 deletions Uninstall.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# MiniModules.Uninstall module preparation

The owner-approved MiniModules.Uninstall 1.0.1 manifest wraps the existing Uninstall.psm1 without changing its
implementation. Importing it exports Uninstall-Application and performs no
uninstall operation. Execution requires Windows registry/msiexec facilities.

The Gallery name Uninstall currently refers to an unlisted script owned by
DimaStadub, not one of the configured Stadub/MiniModules module routes. The new module uses the distinct
MiniModules.Uninstall name and the owner-selected MiniModules account; it does not
replace, relist or claim that legacy script.
No Gallery upload, relisting, ownership transfer or uninstall was performed.

The package contains only the module, manifest, this document and the existing
repository BSD-2-Clause LICENSE. It must never include unrelated monorepo files.
Tests cover safe import and the public parameter contract; actual registry lookup
and software removal remain unvalidated legacy behavior.
Loading