You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
PSMessageDetails :
Exception : System.Reflection.TargetInvocationException: Exception has been thrown by the target of an
invocation. ---> System.Management.Automation.RuntimeException: Unable to find type
[Microsoft.SqlServer.Replication.Article].
at System.Management.Automation.TypeOps.ResolveTypeName(ITypeName typeName, IScriptExtent
errorPos)
at System.Management.Automation.TypeOps.ResolveTypeName(ITypeName typeName, IScriptExtent
errorPos)
at System.Management.Automation.Language.Compiler.GetAttribute(TypeConstraintAst
typeConstraintAst)
at System.Management.Automation.Language.Compiler.GetRuntimeDefinedParameter(ParameterAst
parameterAst, Boolean& customParameterSet, Boolean& usesCmdletBinding)
at System.Management.Automation.Language.Compiler.GetParameterMetaData(ReadOnlyCollection`1
parameters, Boolean automaticPositions, Boolean& usesCmdletBinding)
at System.Management.Automation.CompiledScriptBlockData.InitializeMetadata()
at System.Management.Automation.CompiledScriptBlockData.get_CmdletBindingAttribute()
at System.Management.Automation.CommandMetadata..ctor(ScriptBlock scriptblock, String
commandName, ExecutionContext context)
at System.Management.Automation.FunctionInfo.get_CommandMetadata()
at System.Management.Automation.CommandInfo.GenerateCommandParameterSetInfo()
at System.Management.Automation.CommandInfo.get_ParameterSets()
at
Microsoft.PowerShell.Commands.ShowCommandExtension.ShowCommandCommandInfo..ctor(CommandInfo
other)
at
Microsoft.PowerShell.Commands.ShowCommandInternal.ShowCommandHelper.GetCommandList(Object[]
commandObjects)
--- End of inner exception stack trace ---
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature
sig, Boolean constructor)
at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[]
parameters, Object[] arguments)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder
binder, Object[] parameters, CultureInfo culture)
at Microsoft.PowerShell.Commands.ShowCommandProxy.GetCommandList(Object[] commandObjects)
at Microsoft.PowerShell.Commands.ShowCommandCommand.CanProcessRecordForAllCommands()
at Microsoft.PowerShell.Commands.ShowCommandCommand.ProcessRecord()
at System.Management.Automation.CommandProcessor.ProcessRecord()
TargetObject :
CategoryInfo : NotSpecified: (:) [Show-Command], TargetInvocationException
FullyQualifiedErrorId : System.Reflection.TargetInvocationException,Microsoft.PowerShell.Commands.ShowCommandCommand
ErrorDetails :
InvocationInfo : System.Management.Automation.InvocationInfo
ScriptStackTrace : at <ScriptBlock>, <No file>: line 1
PipelineIterationInfo : {}
Steps to Reproduce
Import-Module dbatools
Show-Command# Results in error# For completeness, how I proved it was dbatools:Remove-Module dbatools
Show-Command# No longer results in error.
Please confirm that you are running the most recent version of dbatools
2.1.7
Other details or mentions
After getting the full error details, it occurred to me based on the error that it was likely a command that took in a pipeline object, and something about the object. So to determine the command(s) causing issues I ran: get-command -Module dbatools | % { $cmd = $_.name; try { show-command $cmd } catch { Write-Host $cmd } } and just held down the Escape key to close all the Show-Command windows that appeared. It eventually came back with Remove-DbaReplArticle and Remove-DbaReplPublication. Based on the error variables from those commands it looks like it's the Microsoft.SqlServer.Replication.Publication and Microsoft.SqlServer.Replication.Article types causing issues.
What PowerShell host was used when producing this error
Verified issue does not already exist?
I have searched and found no existing issue
What error did you receive?
Steps to Reproduce
Please confirm that you are running the most recent version of dbatools
2.1.7
Other details or mentions
After getting the full error details, it occurred to me based on the error that it was likely a command that took in a pipeline object, and something about the object. So to determine the command(s) causing issues I ran:
get-command -Module dbatools | % { $cmd = $_.name; try { show-command $cmd } catch { Write-Host $cmd } }
and just held down the Escape key to close all the Show-Command windows that appeared. It eventually came back withRemove-DbaReplArticle
andRemove-DbaReplPublication
. Based on the error variables from those commands it looks like it's theMicrosoft.SqlServer.Replication.Publication
andMicrosoft.SqlServer.Replication.Article
types causing issues.What PowerShell host was used when producing this error
Windows PowerShell (powershell.exe)
PowerShell Host Version
SQL Server Edition and Build number
N/A
.NET Framework Version
The text was updated successfully, but these errors were encountered: