powershell-v6.0

Powershell determine new URL of a permanently moved (redirected) resource

家住魔仙堡 提交于 2020-01-23 01:48:06
问题 I'm using Powershell Core v6-beta.5 using AppImage on Linux. Is there a way to find out the "new" location of a 301 redirect? Invoke-WebRequest -Method HEAD http://SomethingThatThrows301.com/ -MaximumRedirection 0 throws an error ( Response status code does not indicate success: 301 (Moved Permanently) ). While the error does mention that the move is a 301, I'd still like a proper object telling me that, and the new address. Is there a way to do so? 回答1: Note: All code below works in both

PowerShell 6 - support for Windows GUI libraries

淺唱寂寞╮ 提交于 2019-12-24 06:16:07
问题 I understand that the new PowerShell 6/core lacks support for Windows GUI libraries, I have developed some important projects in PS-5.1 using the Windows.Forms .NET classes. Problem: We are planning to upgrade to PowerShell 6 this summer, which means I will lose all the GUI functionalities (developed using Windows.Forms). Question: What should we do in this situation in order to retain the GUI functionality in our PS apps. Do you envisage Microsoft will provide any alternatives for GUI

How to start a new PowerShell session from another PS session, and run a CmdLet with splatted Parameters

三世轮回 提交于 2019-12-10 10:02:37
问题 The Goal: Is to be able to test to see if PowerShell v6 is installed (which is OK), and if it is, then to invoke that shell for certain CmdLets. This will be invoked within a script running in PowerShell v5.1. I cannot shift fully to v6 as there are other dependencies that do not yet work in this environment, however, v6 offers significant optimisations on certain CmdLets that lead to an improvement in operation of over 200 times (specifically, an Invoke-WebRequest where the call will lead to

How to start a new PowerShell session from another PS session, and run a CmdLet with splatted Parameters

对着背影说爱祢 提交于 2019-12-05 19:22:23
The Goal: Is to be able to test to see if PowerShell v6 is installed (which is OK), and if it is, then to invoke that shell for certain CmdLets. This will be invoked within a script running in PowerShell v5.1. I cannot shift fully to v6 as there are other dependencies that do not yet work in this environment, however, v6 offers significant optimisations on certain CmdLets that lead to an improvement in operation of over 200 times (specifically, an Invoke-WebRequest where the call will lead to a download of a large file - in v5.1 a 4GB file will take over 1 hour to download, in v6 this will