Public/Update-ModuleOSDSoftware.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
<#
.SYNOPSIS
Updates the OSDSoftware PowerShell Module to the latest version
 
.DESCRIPTION
Updates the OSDSoftware PowerShell Module to the latest version from the PowerShell Gallery
 
.LINK
https://osdsoftware.osdeploy.com/module/functions/update-moduleosdsoftware
 
.Example
Update-ModuleOSDSoftware
#>

function Update-ModuleOSDSoftware {
    [CmdletBinding()]
    PARAM ()
    try {
        Write-Warning "Uninstall-Module -Name OSDSoftware -AllVersions -Force"
        Uninstall-Module -Name OSDSoftware -AllVersions -Force
    }
    catch {}

    try {
        Write-Warning "Install-Module -Name OSDSoftware -Force"
        Install-Module -Name OSDSoftware -Force
    }
    catch {}

    try {
        Write-Warning "Import-Module -Name OSDSoftware -Force"
        Import-Module -Name OSDSoftware -Force
    }
    catch {}
}