Open o-l-a-v opened 9 months ago
Thanks for reporting. Did Resolve-AzError not return anything?
@dolauli let's look into it tomorrow.
I answered in the vscode-powershell
issue @isra-fel. Doesn't look obvious to me that this is Az
's fault alone.
@o-l-a-v @isra-fel
GetScriptCmdlet is called when autogen module is imported to get the function cmdlets within a folder. And the code is as below.
public static IEnumerable<FunctionInfo> GetScriptCmdlets(PSCmdlet cmdlet, string scriptFolder)
{
// https://stackoverflow.com/a/40969712/294804
var wrappedFolder = scriptFolder.Contains("'") ? $@"""{scriptFolder}""" : $@"'{scriptFolder}'";
var getCmdletsCommand = $@"
$currentFunctions = Get-ChildItem function:
Get-ChildItem -Path {wrappedFolder} -Recurse -Include '*.ps1' -File | ForEach-Object {{ . $_.FullName }}
Get-ChildItem function: | Where-Object {{ ($currentFunctions -notcontains $_) -and $_.CmdletBinding }}
";
return cmdlet?.RunScript<FunctionInfo>(getCmdletsCommand) ?? RunScript<FunctionInfo>(getCmdletsCommand);
}
I do not see the issue in pwsh 7
. Could it be an issue of vscode-powershell
?
Description
I've had the same issue with
Az.Accounts
earlier. Thought it wasvscode-powershell
s fault, but seems it wasAz
.Here's what happened today: I started writing down a script to
Get-AzSentinelDataConnector
. Suddenly the terminal outputs the following and won't finish/quit unless I do CTRL+C:Issue script & Debug output
Environment data
vscode-powershell
v2023.8.0Module versions
Error output