> ## Content Index
> Fetch the complete content index at: https://codeisahighway.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# BUG: PowerShell workflow execution hang when using PSObject parameter in a new PowerShell session
- URL: https://codeisahighway.com/bug-powershell-workflow-execution-hang-when-using-psobject-parameter-in-a-new-powershell-session/
- Published: 2015-03-25T15:33:04.000Z
- Updated: 2026-07-31T19:45:04.000Z
- Author: Stephane Lapointe
- Tags: PowerShell, DevOps, Bug, PowerShell Workflows, #Import 2023-07-11 16:44, #Import 2026-09-04 10:31, #Import 2026-09-04 13:56

One upon a time... I was playing with PowerShell workflows to automate stuff in Azure.

The scripts were doing what I wanted them to, but the day after I started to have problems when trying to execute them again.

After an hour of trials and errors, I discovered that if I have a parameter type declared in a workflow, in my case it was \[PSObject\], the execution hung to never come back... and I mean *never*.

## Non working snippet

```
$VerbosePreference = 'Continue'

workflow Test-ScaleInfo {
    param(
    	[PSObject]
        $ScaleInfo
    )
    Write-Verbose 'Hello world'
}

@{Test='adasdd'} | Test-ScaleInfo

```

## Working snippet

```
$VerbosePreference = 'Continue'

workflow Test-ScaleInfo {
    param(
        $ScaleInfo
    )
    Write-Verbose 'Hello world'
}

@{Test='adasdd'} | Test-ScaleInfo

```

One thing that let me think it might be an initialization issue... if I take the working snippet and execute it in a new PowerShell session *before* executing the non working snippet, the non working snippet will now work.

## Workaround

What will work until this is fixed? Simply remove the type declaration from your parameter.

A bug have been opened on Microsoft Connect for this issue.  
[Bug#1203243 on Microsoft Connect](https://connect.microsoft.com/PowerShell/feedbackdetail/view/1203243/workflow-execution-hang-when-using-psobject-parameter-in-a-new-powershell-session?ref=codeisahighway.com)