Tool: Visual Studio, Visual Studio Code, PSScriptPad, PowerShell Module
Version:
After packaging my PS1 file I can use some of it but not all of it. When running one of the commands linked to a button the commands will start and after a certain amount of time the exe will just close out without warning or crash report. Please help!!! I also noticed that the output console in VSCode is throwing a ton of errors and sometimes I have to restart it to get it to package at all.
Below is some of the output:
Starting PowerShell Pro Tools host from: c:\Users\curtp.vscode\extensions\ironmansoftware.powershellprotools-5.26.0\out\windows\PowerShellProTools.Host.exe}
Process started
connect
Started to PowerShell Pro Tools process.
Scheduling command for main runspace: $Commands = Get-Command ‘Set-Variable’ -ErrorAction SilentlyContinue; if ($Commands) { try { [System.Management.Automation.ProxyCommand]::Create((New-Object System.Management.Automation.CommandMetaData $Commands)) } catch { } } else { ‘’ }
Error executing PowerShell: Exception calling “InvokeCommand” with “1” argument(s): “Timed out waiting on runspace scheduler.”
Executing command: Get-Module -ListAvailable
Scheduling command for main runspace: Get-Content (Get-PSReadLineOption).HistorySavePath
Error executing PowerShell: Exception calling “InvokeCommand” with “1” argument(s): “Timed out waiting on runspace scheduler.”
Scheduling command for main runspace: [PowerShellToolsPro.VSCode.TreeViewService]::Instance.GetTreeViews() | ConvertTo-Json -WarningAction SilentlyContinue
Error executing PowerShell: Exception calling “InvokeCommand” with “1” argument(s): “Timed out waiting on runspace scheduler.”
Exception running command: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
—> System.InvalidOperationException: Sequence contains no elements
at System.Linq.ThrowHelper.ThrowNoElementsException()
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at PowerShellToolsPro.PoshToolsServer.GetTreeViews() in D:\a\1\s\PowerShellProTools.Host\PoshToolsServer.cs:line 803
— End of inner exception stack trace —
at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at PowerShellToolsPro.PoshToolsServer.Start(String pipeName) in D:\a\1\s\PowerShellProTools.Host\PoshToolsServer.cs:line 97
Executing command: [PowerShellToolsPro.Cmdlets.VSCode.PSAssembly]::GetAssemblies()
Scheduling command for main runspace: Get-PSSession | ForEach-Object { [PowerShellToolsPro.Cmdlets.VSCode.Session]$_ } | ConvertTo-Json -WarningAction SilentlyContinue
Error executing PowerShell: Exception calling “InvokeCommand” with “1” argument(s): “Timed out waiting on runspace scheduler.”
Exception running command: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
—> System.InvalidOperationException: Sequence contains no elements
at System.Linq.ThrowHelper.ThrowNoElementsException()
at System.Linq.Enumerable.First[TSource](IEnumerable`1 source)
at PowerShellToolsPro.PoshToolsServer.GetSessions() in D:\a\1\s\PowerShellProTools.Host\PoshToolsServer.cs:line 831
— End of inner exception stack trace —
at System.Runti
meMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
at PowerShellToolsPro.PoshToolsServer.Start(String pipeName) in D:\a\1\s\PowerShellProTools.Host\PoshToolsServer.cs:line 97
Scheduling command for main runspace: Get-Variable | Out-PoshToolsVariable -PassThru | ConvertTo-Json -Depth 1 -WarningAction SilentlyContinue