From e162c059006d665f9ea9edd584e5bc3c5e948988 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Fri, 10 Sep 2021 17:31:15 +0200 Subject: [PATCH] Fix Publish on PSGallery (with PS Core) (#24) * Connect: Add System.Web to Type (Assembly) for PS 5.0 * NetboxPS(.psd1): Remove Required Assemblies (System.web) requirement --- Functions/Setup/Connect-NetboxAPI.ps1 | 2 ++ NetboxPS.psd1 | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/Functions/Setup/Connect-NetboxAPI.ps1 b/Functions/Setup/Connect-NetboxAPI.ps1 index b012a0f..5626dfb 100644 --- a/Functions/Setup/Connect-NetboxAPI.ps1 +++ b/Functions/Setup/Connect-NetboxAPI.ps1 @@ -85,6 +85,8 @@ #for PowerShell (<=) 5 (Desktop), Enable TLS 1.1, 1.2 and Disable SSL chain trust if ("Desktop" -eq $PSVersionTable.PsEdition) { + #Add System.web (Need for ParseQueryString) + Add-Type -AssemblyName System.Web #Enable TLS 1.1 and 1.2 Set-NetboxCipherSSL if ($SkipCertificateCheck) { diff --git a/NetboxPS.psd1 b/NetboxPS.psd1 index 3cb6799..d2ce728 100644 --- a/NetboxPS.psd1 +++ b/NetboxPS.psd1 @@ -54,7 +54,7 @@ CLRVersion = '2.0.50727' # RequiredModules = @() # Assemblies that must be loaded prior to importing this module -RequiredAssemblies = 'System.Web' +#RequiredAssemblies = '' # Script files (.ps1) that are run in the caller's environment prior to importing this module. # ScriptsToProcess = @()