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


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

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

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