microsoft / SharePointDSC.Reverse

Extracts a Desired State Configuration Script from an existing SharePoint Farm
MIT License
40 stars 27 forks source link

Scripts fails with "A parameter cannot be found that matches parameter name 'UseGetTargetResource'" #96

Closed PowershellNinja closed 4 years ago

PowershellNinja commented 4 years ago

Details of the scenario you try and problem that is occurring:

When I use the SharePointDSC.Reverse.ps1 script with the current version of the ReverseDSC module (2.0.0.2), regardless of the extraction configuration I always get a error file containing the following error: A parameter cannot be found that matches parameter name 'UseGetTargetResource'.

Example of the Extraction process (Extraction of Managed Properties only):

PS C:\Program Files\WindowsPowerShell\Scripts> .\SharePointDSC.Reverse.ps1 -ComponentsToExtract @("SPSearchManagedProper
ty")
Scanning Operating System Version...
Scanning Operating System Settings [1/7] for server {server01}
Scanning Operating System Settings [1/7] for server {server02}
Scanning Operating System Settings [1/7] for server {server03}
Scanning Operating System Settings [1/7] for server {SQLContent}
Scanning Operating System Settings [1/7] for server {SQLOther}
Scanning Operating System Settings [1/7] for server {SQLSearch}
Scanning SQL Server Version...
Scanning Patch Levels...
Configuring Dependencies...
[ server01 ] Generating the SharePoint Prerequisites Installation...
[ server01 ] Generating the SharePoint Binary Installation...
[ server01 ] Scanning Search Managed Properties...
Scanning Managed Properties for Search Service Application [1/1] {Search Service Application}
    -> Scanning Managed Property [1/1291] {03/2014OWSNMBR}
VERBOSE: Executing as the local run as user DOMAIN\farmadminuser
VERBOSE: Leaving BeginProcessing Method of Get-SPEnterpriseSearchServiceApplication.
VERBOSE: Leaving ProcessRecord Method of Get-SPEnterpriseSearchServiceApplication.
VERBOSE: Leaving EndProcessing Method of Get-SPEnterpriseSearchServiceApplication.
VERBOSE: Leaving BeginProcessing Method of Get-SPEnterpriseSearchMetadataManagedProperty.
VERBOSE: Leaving ProcessRecord Method of Get-SPEnterpriseSearchMetadataManagedProperty.
VERBOSE: Leaving EndProcessing Method of Get-SPEnterpriseSearchMetadataManagedProperty.
[ server01 ] Configuring Local Configuration Manager (LCM)...
[ server02 ] Generating the SharePoint Prerequisites Installation...
[ server02 ] Generating the SharePoint Binary Installation...
[ server02 ] Configuring Local Configuration Manager (LCM)...
[ server03 ] Configuring Local Configuration Manager (LCM)...
Configuring Credentials...
Please enter the full path of the output folder for DSC Configuration (will be created as necessary): C:\Temp\SharePoint
DSC.Reverse

After some investigation I found that this was a parameter on the "Get-DSCBlock" cmdlet that was removed from the ReverseDSC module on Oct 30, 2019 in commit ce969b01fd769669fb19fb0bd8fffa522f011bc9.

The DSC configuration that is using the resource: N/A Version of the Operating System and PowerShell the DSC Target Node is running: Server 2012 R2, Powershell 5.1 Version of the DSC module you're using: 3.4.0.0

PowershellNinja commented 4 years ago

Closing this issue as fixed in 67a17d86a6340e15cb4c49ff6efc6e1d1a3a77e3