dsccommunity / dsccommunity/SharePointDsc

Error on creating new SPVisioServiceApplication: Command not found

Open
#1,392 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs investigation
Dominant language
C#
Stars
246
Forks
106
PR merge metrics
No merged PRs in 30d

Description

Problem description

When creating a new Visio Service application, I'm getting that the command new-SPVisioServiceApplication is not found.
This is a fresh rollout of SP2019 on Windows 2019 servers. I believe line 111 in the MSFT_SPVisioServiceApp resource generates the issue. Just to make sure, I checked if something was off with my Sharepoint snapin, but the New-SPVisioServiceApplication cmdlet is there.
Other webapplications are getting created succesfully.

DSC Operational log:

Job {658948CE-987B-11EC-8DB2-EE000000024D} : 
MIResult: 1
Error Message: PowerShell DSC resource MSFT_SPVisioServiceApp  failed to execute Set-TargetResource functionality with error message: The term 'New-SPVisioServiceApplication' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. 
Message ID: ProviderOperationExecutionFailure
Error Category: 7
Error Code: 1
Error Type: MI
Job {658948CE-987B-11EC-8DB2-EE000000024D} : 
Message The term 'New-SPVisioServiceApplication' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. 
HResult -2146233087 
StackTrack    at System.Management.Automation.Runspaces.AsyncResult.EndInvoke()
   at System.Management.Automation.PowerShell.CoreInvokeRemoteHelper[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.CoreInvoke[TInput,TOutput](PSDataCollection`1 input, PSDataCollection`1 output, PSInvocationSettings settings)
   at System.Management.Automation.PowerShell.Invoke(IEnumerable input, PSInvocationSettings settings)
   at Microsoft.PowerShell.DesiredStateConfiguration.Internal.ResourceProviderAdapter.ExecuteCommand(PowerShell powerShell, ResourceModuleInfo resInfo, String operationCmd, List`1 acceptedProperties, CimInstance nonResourcePropeties, CimInstance resourceConfiguration, LCMDebugMode debugMode, PSInvocationSettings pSInvocationSettings, UInt32& resultStatusHandle, Collection`1& result, ErrorRecord& errorRecord, PSModuleInfo localRunSpaceModuleInfo)
Verbose logs
{"time": "2022-02-28T11:06:28.511+01:00", "type": "verbose", "message": "[APP01]: LCM:  [ Start  Resource ]  [[SPVisioServiceApp]VisioServiceApplication]  "},
  {"time": "2022-02-28T11:06:28.511+01:00", "type": "verbose", "message": "[APP01]: LCM:  [ Start  Test     ]  [[SPVisioServiceApp]VisioServiceApplication]  "},
  {"time": "2022-02-28T11:06:28.932+01:00", "type": "verbose", "message": "[APP01]:                            [[SPVisioServiceApp]VisioServiceApplication] Testing Visio Graphics service app 'Visio Graphics Service Application'"},
  {"time": "2022-02-28T11:06:28.932+01:00", "type": "verbose", "message": "[APP01]:                            [[SPVisioServiceApp]VisioServiceApplication] Getting Visio Graphics service app 'Visio Graphics Service Application'"},
  {"time": "2022-02-28T11:06:28.932+01:00", "type": "verbose", "message": "[APP01]:                            [[SPVisioServiceApp]VisioServiceApplication] Executing as the local run as user domain\\setupaccount"},
  {"time": "2022-02-28T11:06:28.932+01:00", "type": "verbose", "message": "[APP01]:                            [[SPVisioServiceApp]VisioServiceApplication] Leaving BeginProcessing Method of Get-SPServiceApplication."},
  {"time": "2022-02-28T11:06:28.932+01:00", "type": "verbose", "message": "[APP01]:                            [[SPVisioServiceApp]VisioServiceApplication] Leaving ProcessRecord Method of Get-SPServiceApplication."},
  {"time": "2022-02-28T11:06:28.932+01:00", "type": "verbose", "message": "[APP01]:                            [[SPVisioServiceApp]VisioServiceApplication] Leaving EndProcessing Method of Get-SPServiceApplication."},
  {"time": "2022-02-28T11:06:28.932+01:00", "type": "verbose", "message": "[APP01]:                            [[SPVisioServiceApp]VisioServiceApplication] Current Values: ApplicationPool=SharePoint Web Services Default; Ensure=Absent; Name=Visio Graphics Service Application"},
  {"time": "2022-02-28T11:06:28.932+01:00", "type": "verbose", "message": "[APP01]:                            [[SPVisioServiceApp]VisioServiceApplication] Target Values: ApplicationPool=SharePoint Web Services Default; Ensure=Present; Name=Visio Graphics Service Application; ProxyName=Visio Graphics Service Application Proxy; Verbose=True"},
  {"time": "2022-02-28T11:06:28.932+01:00", "type": "verbose", "message": "[APP01]:                            [[SPVisioServiceApp]VisioServiceApplication] Test-TargetResource returned False"},
  {"time": "2022-02-28T11:06:28.932+01:00", "type": "verbose", "message": "[APP01]: LCM:  [ End    Test     ]  [[SPVisioServiceApp]VisioServiceApplication]  in 0.4220 seconds."},
  {"time": "2022-02-28T11:06:28.932+01:00", "type": "verbose", "message": "[APP01]: LCM:  [ Start  Set      ]  [[SPVisioServiceApp]VisioServiceApplication]  "},
  {"time": "2022-02-28T11:06:29.261+01:00", "type": "verbose", "message": "[APP01]:                            [[SPVisioServiceApp]VisioServiceApplication] Setting Visio Graphics service app 'Visio Graphics Service Application'"},
  {"time": "2022-02-28T11:06:29.261+01:00", "type": "verbose", "message": "[APP01]:                            [[SPVisioServiceApp]VisioServiceApplication] Getting Visio Graphics service app 'Visio Graphics Service Application'"},
  {"time": "2022-02-28T11:06:29.261+01:00", "type": "verbose", "message": "[APP01]:                            [[SPVisioServiceApp]VisioServiceApplication] Executing as the local run as user domain\\setupaccount"},
  {"time": "2022-02-28T11:06:29.261+01:00", "type": "verbose", "message": "[APP01]:                            [[SPVisioServiceApp]VisioServiceApplication] Leaving BeginProcessing Method of Get-SPServiceApplication."},
  {"time": "2022-02-28T11:06:29.261+01:00", "type": "verbose", "message": "[APP01]:                            [[SPVisioServiceApp]VisioServiceApplication] Leaving ProcessRecord Method of Get-SPServiceApplication."},
  {"time": "2022-02-28T11:06:29.261+01:00", "type": "verbose", "message": "[APP01]:                            [[SPVisioServiceApp]VisioServiceApplication] Leaving EndProcessing Method of Get-SPServiceApplication."},
  {"time": "2022-02-28T11:06:29.261+01:00", "type": "verbose", "message": "[APP01]:                            [[SPVisioServiceApp]VisioServiceApplication] Creating Visio Graphics Service Application Visio Graphics Service Application"},
  {"time": "2022-02-28T11:06:29.261+01:00", "type": "verbose", "message": "[APP01]:                            [[SPVisioServiceApp]VisioServiceApplication] Executing as the local run as user domain\\setupaccount"},
  {"time": "2022-02-28T11:06:29.292+01:00", "type": "verbose", "message": "[APP01]: LCM:  [ End    Set      ]  [[SPVisioServiceApp]VisioServiceApplication]  in 0.3600 seconds."},
  {"time": "2022-02-28T11:06:29.292+01:00", "type": "error", "message": "PowerShell DSC resource MSFT_SPVisioServiceApp  failed to execute Set-TargetResource functionality with error message: The term 'New-SPVisioServiceApplication' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. "},
DSC configuration
SPVisioServiceApp VisioServiceApplication{
            Name                 = "Visio Graphics Service Application";
            ProxyName            = "Visio Graphics Service Application Proxy";
            ApplicationPool      = "SharePoint Web Services Default";
            PsDscRunAsCredential = $SPSetupAccount;
            DependsOn            = "[SPServiceAppPool]SharePointWebServicesDefault"
        }
Suggested solution

Checking for the command in memory, if not, adding sharepoint pssnapin?

SharePoint version and build
Sharepoint 2019 (16.0.10383.20001)
Operating system the target node is running
OsName               : Microsoft Windows Server 2019 Standard
OsOperatingSystemSKU : StandardServerEdition
OsArchitecture       : 64-bit
WindowsVersion       : 1809
WindowsBuildLabEx    : 17763.1.amd64fre.rs5_release.180914-1434
OsLanguage           : en-US
OsMuiLanguages       : {en-US}
PowerShell version and build the target node is running
Name                           Value
----                           -----
PSVersion                      5.1.17763.2268
PSEdition                      Desktop
PSCompatibleVersions           {1.0, 2.0, 3.0, 4.0...}
BuildVersion                   10.0.17763.2268
CLRVersion                     4.0.30319.42000
WSManStackVersion              3.0
PSRemotingProtocolVersion      2.3
SerializationVersion           1.1.0.1
SharePointDsc version
Name          Version Path
----          ------- ----
SharePointDSC 5.0.0   C:\Program Files\WindowsPowerShell\Modules\SharePointDSC\5.0.0\SharePointDSC.psd1

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Inspect the MSFT_SPVisioServiceApp resource around line 111 and compare its DSC execution context with the reported SharePoint session. Check how the SharePoint snap-in or cmdlet availability is handled before New-SPVisioServiceApplication is called, then reproduce the configuration and confirm that the Visio service application is created without the command-not-found error.

Written by the indexing model from the issue text.

Assessment

Tech stack
powershell
Domain
devops
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.