Scripts/install-7zip-winget.ps1

<#
.SYNOPSIS
  Wrapper script for installing 7-zip by Winget
 
.DESCRIPTION
  Provides functionality for downloading and installing packages, including logging and exit codes.
 
.PARAMETER User
  Mandatory : Generic or customer specific login on dist server. Use quotation marks!
.PARAMETER Pass
  Mandatory : Password for dist server (mandatory). Use quotation marks!
 
.EXAMPLE
  > Powershell.exe -ExecutionPolicy ByPass -File .\install-SomeApplication.ps1 -User "CUST-Kakbolaget" -Pass "sup3rs3cr3tp@ssw0rd"
 
.NOTES
  Version: 2.2
  Author: Mikael Karlsson
 
  Version history
  1.0 2023-10-09 - Initial release
 
.LINK
  Documentation: https://nordlosthc.eu.itglue.com/1649140723777754/documents/folder/3389170169659635/
  Wrapper scripts: https://nordlo.sharepoint.com/:f:/r/sites/city/Leverans/Internt/St%C3%B6dsystem/Dist/Install%20Wrappers?csf=1&web=1&e=OmV9eo
#>


[CmdletBinding()]
Param(
  [Parameter(Mandatory=$false)] [String]$User,
  [Parameter(Mandatory=$false)] [string]$Pass,
  [Parameter(Mandatory=$false)][ValidateSet("Leave","Remove")][string]$PublicDesktopShortcuts="Leave"
)

$FunctionsLibrary = "DeployLibNorEvo"
$Global:User = $User
$Global:Pass = $Pass
$Global:PublicDesktopShortcuts = $PublicDesktopShortcuts
$Global:ScriptName = Split-Path -Leaf $MyInvocation.MyCommand.Path
$null = Install-PackageProvider -Name "NuGet" -Force
Remove-Module $FunctionsLibrary -Force -ErrorAction SilentlyContinue
Install-Module -Name $FunctionsLibrary -Force
Start-NEDeploySession

### Custom Code Starts ####################################################################################################################

### Install 7-Zip
Install-NEWingetApplication -Id "7zip.7zip"

### Custom Code Ends ####################################################################################################################
Invoke-NEFinalAction