dsccommunity / SharePointDsc

The SharePointDsc PowerShell module provides DSC resources that can be used to deploy and manage a SharePoint farm
MIT License
245 stars 107 forks source link

Remove unnecessary Import-Module in SharePoint Subscription to fix error in 23H1 #1425

Closed Yvand closed 1 year ago

Yvand commented 1 year ago

Pull Request (PR) description

Starting with SharePoint Subscription 21H1, running Import-Module SharePointServer -Verbose:$false causes an exception.
This PR removes this import if it detects SharePoint Subscription as it is unnecessary (even in SharePoint Subscription RTM)

This Pull Request (PR) fixes the following issues

Task list


This change is Reviewable

ykuijs commented 1 year ago

Hi @Yvand, thanks for testing and submitting this PR. Unfortunately, the unit tests are failing because you have fully removed the $basescript variable, which is being used later in the script. Could you update this to $basescript = '' instead of deleting the entire else-block? And also please add an item to the changelog.....the quality checks are failing because of that ;-)

codecov[bot] commented 1 year ago

Codecov Report

Merging #1425 (19504ad) into master (8dba53d) will not change coverage. The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1425   +/-   ##
======================================
  Coverage      84%     84%           
======================================
  Files         145     145           
  Lines       22647   22647           
======================================
  Hits        19076   19076           
  Misses       3571    3571           
Impacted Files Coverage Δ
...Modules/SharePointDsc.Util/SharePointDsc.Util.psm1 51% <100%> (ø)