From 66b65484de61334d00546176346c23576b43ba44 Mon Sep 17 00:00:00 2001 From: Yvan Duhamel Date: Mon, 20 Mar 2023 16:52:54 +0100 Subject: [PATCH 1/3] remove unnecessary Import-Module in Subscription --- .../Modules/SharePointDsc.Util/SharePointDsc.Util.psm1 | 7 ------- 1 file changed, 7 deletions(-) diff --git a/SharePointDsc/Modules/SharePointDsc.Util/SharePointDsc.Util.psm1 b/SharePointDsc/Modules/SharePointDsc.Util/SharePointDsc.Util.psm1 index 53d0d7508..459010399 100644 --- a/SharePointDsc/Modules/SharePointDsc.Util/SharePointDsc.Util.psm1 +++ b/SharePointDsc/Modules/SharePointDsc.Util/SharePointDsc.Util.psm1 @@ -664,13 +664,6 @@ function Invoke-SPDscCommand Add-PSSnapin Microsoft.SharePoint.PowerShell } -"@ - } - else - { - $baseScript = @" - Import-Module SharePointServer -Verbose:`$false -WarningAction SilentlyContinue - "@ } From e99c655f6c644c11d290b85da6f42edb4635a53d Mon Sep 17 00:00:00 2001 From: Yvan Duhamel Date: Mon, 3 Apr 2023 09:54:39 +0200 Subject: [PATCH 2/3] set $baseScript to an empty string --- .../Modules/SharePointDsc.Util/SharePointDsc.Util.psm1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/SharePointDsc/Modules/SharePointDsc.Util/SharePointDsc.Util.psm1 b/SharePointDsc/Modules/SharePointDsc.Util/SharePointDsc.Util.psm1 index 459010399..d328e7374 100644 --- a/SharePointDsc/Modules/SharePointDsc.Util/SharePointDsc.Util.psm1 +++ b/SharePointDsc/Modules/SharePointDsc.Util/SharePointDsc.Util.psm1 @@ -666,6 +666,10 @@ function Invoke-SPDscCommand "@ } + else + { + $baseScript = "" + } $invokeArgs = @{ ScriptBlock = [ScriptBlock]::Create($baseScript + $ScriptBlock.ToString()) From 19504adfd27a22006ac498b4f0dd9fb0533be3fb Mon Sep 17 00:00:00 2001 From: Yvan Duhamel Date: Mon, 3 Apr 2023 09:59:41 +0200 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index c43f4ca50..cefb04903 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,13 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- SharePointDsc + - Remove unnecessary Import-Module to fix an error when running resource SPFarm + on a server with SharePoint Subscription 23H1 that has never been joined to + a farm. + +### Fixed + - Export - Fixed issue where the export would not run on Subscription Edition - SPTrustedRootAuthority