forked from dsccommunity/xPSDesiredStateConfiguration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
xMsiPackage_UninstallPackageFromFileConfig.ps1
55 lines (47 loc) · 1.71 KB
/
xMsiPackage_UninstallPackageFromFileConfig.ps1
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
<#PSScriptInfo
.VERSION 1.0.1
.GUID 33aa3450-fa8a-4eb7-9291-c0d374e7778e
.AUTHOR Microsoft Corporation
.COMPANYNAME Microsoft Corporation
.COPYRIGHT
.TAGS DSCConfiguration
.LICENSEURI https://github.com/PowerShell/xPSDesiredStateConfiguration/blob/master/LICENSE
.PROJECTURI https://github.com/PowerShell/xPSDesiredStateConfiguration
.ICONURI
.EXTERNALMODULEDEPENDENCIES
.REQUIREDSCRIPTS
.EXTERNALSCRIPTDEPENDENCIES
.RELEASENOTES First version.
.PRIVATEDATA 2016-Datacenter,2016-Datacenter-Server-Core
#>
#Requires -module 'xPSDesiredStateConfiguration'
<#
.SYNOPSIS
Uninstalls the MSI file with the product ID using a file located at a
file path.
.DESCRIPTION
Uninstalls the MSI file with the product ID: '{DEADBEEF-80C6-41E6-A1B9-8BDB8A05027F}'
at the path: 'file://Examples/example.msi'.
.NOTES
The MSI file with the given product ID must already exist at the specified
path.
The product ID and path value in this file are provided for example
purposes only and will need to be replaced with valid values.
You can run the following command to get a list of all available MSI's
on your system with the correct Path (LocalPackage) and product ID
(IdentifyingNumber):
Get-WmiObject Win32_Product | Format-Table IdentifyingNumber, Name, LocalPackage
#>
Configuration xMsiPackage_UninstallPackageFromFileConfig
{
Import-DscResource -ModuleName 'xPSDesiredStateConfiguration'
Node localhost
{
xMsiPackage 'UninstallMsiPackageFromFile'
{
ProductId = '{DEADBEEF-80C6-41E6-A1B9-8BDB8A05027F}'
Path = 'file://Examples/example.msi'
Ensure = 'Absent'
}
}
}