au icon indicating copy to clipboard operation
au copied to clipboard

[Feature Request] Add PowerShell Core Support

Open Elderry opened this issue 6 years ago • 4 comments

Just a recommendation, currently run script.ps1 will encounter:

Exception setting "SecurityProtocol": "The requested security protocol is not supported."
At C:\Program Files\PowerShell\Modules\au\2018.5.18\Public\Update-Package.ps1:384 char:5
+     [System.Net.ServicePointManager]::SecurityProtocol = 'Ssl3,Tls,Tl ...
+     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [], SetValueInvocationException
+ FullyQualifiedErrorId : ExceptionWhenSetting

and

Get-WebFile : Exception calling "IsBypassed" with "1" argument(s): "Operation is not supported on this platform."
At C:\Users\Ruiyang\AppData\Local\Temp\chocolatey\au\chocolatey\helpers\functions\Get-ChocolateyWebFile.ps1:345 char:7
+       Get-WebFile -Url $url -FileName $fileFullPath -Options $options
+       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Get-WebFile], MethodInvocationException
+ FullyQualifiedErrorId : PlatformNotSupportedException,Get-WebFile

Elderry avatar Jul 03 '18 02:07 Elderry

Get-WebFile is used during automatic chekcsuming which is a feature that doesn't need to be used at all (I almost never do and consider it deprecated, but I will not remove it as others use it a lot).

Regarding [System.Net.ServicePointManager]::SecurityProtocol, this is one liner problem which is trivially easy to fix by somebody that uses AU on pwsh. I will skip v6 and jump to 7 so that will not be me. The point is this is not a deal breaker.

majkinetor avatar Dec 16 '19 10:12 majkinetor

Think I ran into this trying to use au with GitHub Actions, see: https://github.com/pjoe/loadem/runs/1254716907?check_suite_focus=true#step:9:92

pjoe avatar Oct 14 '20 17:10 pjoe

heh, turns out it was defaulting to pwsh (7), after explicitly using powershell things are working as expected :)

pjoe avatar Oct 14 '20 17:10 pjoe

I use it with pwsh7 locally tho...

majkinetor avatar Oct 14 '20 19:10 majkinetor