Product, version and build: 5.4.138
(*** Please do not write "latest" as a version, specify a version number ***)
32 or 64 bit version of product: 64
Operating system: win7
32 or 64 bit OS: 64
PowerShell Version: 5.0
DO NOT POST SUBSCRIPTIONS, KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM
I had a project that worked fine until I installed 5.4.138.
The code I am running is:
$global:EXSession = New-PSSession -Name ExchangeConn -ConfigurationName Microsoft.Exchange -ConnectionUri "http://$ActiveSiteExchange.$domainDNS/PowerShell/" -Authentication Kerberos -ErrorAction Stop
Import-PSSession $global:EXSession -allowclobber -DisableNameChecking -ErrorAction Stop -verbose | out-null
Set-AdServerSettings -PreferredServer $Global:ActiveSiteDCFQDN
which as I said has always worked. The above code is running in a Try block.
The try block now fails with this error:
Running the Get-Command command in a remote session reported the following error: The type initializer for 'Microsoft.PowerShell.Commands.MeasureObjectCommand' threw an exception..
Any ideas?
Thanks
David
5.4.138 bug?
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.
Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Re: 5.4.138 bug?
Now I dont think its a coincidence.
With debugging I am getting the error on the last line of this code:
$scriptCmd = { & $script:InvokeCommand `
@clientSideParameters `
-HideComputerName `
-Session (Get-PSImplicitRemotingSession -CommandName 'Search-Mailbox') `
-Arg ('Search-Mailbox', $PSBoundParameters, $positionalArguments) `
-Script { param($name, $boundParams, $unboundParams) & $name @boundParams @unboundParams } `
}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($myInvocation.CommandOrigin)
$steppablePipeline.Begin($myInvocation.ExpectingInput, $ExecutionContext)
} catch {
throw
}
}
Process {
try {
$steppablePipeline.Process($_)
} catch {
throw
}
}
End {
try {
$steppablePipeline.End()
The error says that Winrm is not running but I am connecting to an exchange server which always has winrm running. I have tried several exchange servers and the same error comes up.
Anything around the above code changed recently?
Thanks
david
With debugging I am getting the error on the last line of this code:
$scriptCmd = { & $script:InvokeCommand `
@clientSideParameters `
-HideComputerName `
-Session (Get-PSImplicitRemotingSession -CommandName 'Search-Mailbox') `
-Arg ('Search-Mailbox', $PSBoundParameters, $positionalArguments) `
-Script { param($name, $boundParams, $unboundParams) & $name @boundParams @unboundParams } `
}
$steppablePipeline = $scriptCmd.GetSteppablePipeline($myInvocation.CommandOrigin)
$steppablePipeline.Begin($myInvocation.ExpectingInput, $ExecutionContext)
} catch {
throw
}
}
Process {
try {
$steppablePipeline.Process($_)
} catch {
throw
}
}
End {
try {
$steppablePipeline.End()
The error says that Winrm is not running but I am connecting to an exchange server which always has winrm running. I have tried several exchange servers and the same error comes up.
Anything around the above code changed recently?
Thanks
david