Henry Buckle

Results 23 comments of Henry Buckle

Workload identity release candidate just came out - any chance to get this merged?

It's something to do with the new error view in PowerShell 7. Try adding `$ErrorView = "NormalView"` at the top of the script

Seems like for some reason the host version in .NET interactive is 0.0.1 ``` function FunctionName { [cmdletbinding()] param () Write-Host $PSCmdlet.Host.Version } FunctionName 0.0.1 ```

This is PSModulePath from the .NET interactive kernel ``` C:\Users\henry.buckle\.nuget\packages\microsoft.dotnet-interactive\1.0.240403\tools\net5.0\any\Modules C:\Users\henry.buckle\Documents\PowerShell\Modules C:\Program Files\PowerShell\Modules c:\users\henry.buckle\.nuget\packages\microsoft.dotnet-interactive\1.0.240403\tools\net5.0\any\runtimes\win\lib\net5.0\Modules C:\Program Files\WindowsPowerShell\Modules C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules ```

@alerickson - I just tried this again and get the same issue with 3.0.17

Save the following as a `.dib` file and open in VSCode with the `ms-dotnettools.dotnet-interactive-vscode` extension ``` #!pwsh $env:PSModulePath -split ';' Get-Module PowerShellGet Get-PSResource -Scope CurrentUser -Name 'Az' -Verbose ``` When...

I think the use of psCmdlet.Host.Version here is wrong - this is the version of the hosting application, not the PowerShell engine https://github.com/PowerShell/PowerShellGet/blob/b005e0fff5fc02ca09e8502b947da9ea13c90b20/src/code/Utils.cs#L723 ![image](https://user-images.githubusercontent.com/18499079/196187376-2fa57c0e-2ebe-4860-82b3-8751b3ce237f.png)

@alerickson, @anamnavi any update?

If it helps this is how PowerShellEditorServices does it https://github.com/PowerShell/PowerShellEditorServices/blob/main/src/PowerShellEditorServices/Utility/VersionUtils.cs

@alerickson @alerickson - will it be fixed for GA? It looks like `psCmdlet.Host.Version` is [still in use](https://github.com/PowerShell/PSResourceGet/blob/dc22d358bc67c0786cef6fae81969f10b0c0c6ab/src/code/Utils.cs#L987)