powershell

How to configure Chocolatey to use a corporate proxy?

霸气de小男生 提交于 2021-01-27 02:37:30
问题 I'm having trouble installing Chocolatey packages from behind a corporate proxy. Internet Explorer is correctly configured but I'm having issues getting it to work through Powershell. I can use the Web-Client to download pages e.g. Microsoft.com, but ultimately Chocolatey fails to download packages with the prompt "Please provide proxy credentials:" which will not accept my domain login as being valid. Sometimes I just get the error "Exception calling "DownloadFile" with "2" argument(s): "The

How to configure Chocolatey to use a corporate proxy?

梦想与她 提交于 2021-01-27 02:36:34
问题 I'm having trouble installing Chocolatey packages from behind a corporate proxy. Internet Explorer is correctly configured but I'm having issues getting it to work through Powershell. I can use the Web-Client to download pages e.g. Microsoft.com, but ultimately Chocolatey fails to download packages with the prompt "Please provide proxy credentials:" which will not accept my domain login as being valid. Sometimes I just get the error "Exception calling "DownloadFile" with "2" argument(s): "The

How to configure Chocolatey to use a corporate proxy?

淺唱寂寞╮ 提交于 2021-01-27 02:36:33
问题 I'm having trouble installing Chocolatey packages from behind a corporate proxy. Internet Explorer is correctly configured but I'm having issues getting it to work through Powershell. I can use the Web-Client to download pages e.g. Microsoft.com, but ultimately Chocolatey fails to download packages with the prompt "Please provide proxy credentials:" which will not accept my domain login as being valid. Sometimes I just get the error "Exception calling "DownloadFile" with "2" argument(s): "The

How to delete ALL Azure resources with powershell

荒凉一梦 提交于 2021-01-26 17:37:43
问题 I need to empty my Azure account from all resources and there's too much to remove individually in the portal. Looking for a powershell script to do this. Thanks. 回答1: As resources in Azure are grouped into resource groups(RG), that would probably be the easiest way to go about this. Use these cmdlets to do this. Get-AzureRmResourceGroup Remove-AzureRmResourceGroup Once you have retrieved all the RGs, you can pipe the results with the | character to the Remove cmdlet and iterate through them

PowerShell - Enumerating through a collection and change the collection

ぐ巨炮叔叔 提交于 2021-01-26 08:34:49
问题 How it is posible to fix this script? Yes, I´m changing the collection in the foreach loop and this is the reason for this error. An error occurred while enumerating through a collection: Collection was modified; enumeration operation may not execute.. At C:\Users\user\Documents\PowerShell\ChangeAllListsV2.ps1:47 char:20 + foreach <<<< ($list in $webLists) + CategoryInfo : InvalidOperation: (Microsoft.Share...on+SPEnumerator:SPEnumerator) [], RuntimeException + FullyQualifiedErrorId :

Can I set PowerShell 'Start-Job' with low priority?

拈花ヽ惹草 提交于 2021-01-26 05:37:28
问题 I would like to lower the priority of the jobs that I start with Start-Job in PowerShell scripts. Is this possible? 回答1: I used this trick right in a job's code (it can be optional, controlled by a parameter): [System.Threading.Thread]::CurrentThread.Priority = 'Lowest' Available priority values: Lowest, BelowNormal, Normal, AboveNormal, Highest 回答2: If you have launched it then you can use this: $a = gps powershell $a.PriorityClass = "BelowNormal" Or you can use this using the key: Get

How to use Extension methods in Powershell?

依然范特西╮ 提交于 2021-01-26 03:09:12
问题 I have the following code: using System public static class IntEx { /// <summary> /// Yields a power of the given number /// </summary> /// <param name="number">The base number</param> /// <param name="powerOf">the power to be applied on te base number</param> /// <returns>Powers applied to the base number</returns> public static IEnumerable<int> ListPowersOf(this int number, int powerOf) { for (var i = number; ; i <<= powerOf) { yield return i; } } } I've loaded the dll in Powershell(Windows

“rm -rf” equivalent for Windows PowerShell? [closed]

倾然丶 夕夏残阳落幕 提交于 2021-01-25 07:10:45
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 9 months ago . Improve this question I have already read the question "rm -rf" equivalent for Windows?. And I have also tried the following commands: $ rm app $ rmdir /s /q app $ rmdir -s -q app $ rd /s /q app and many other variations. It always prompts me with: The item at C:

“rm -rf” equivalent for Windows PowerShell? [closed]

丶灬走出姿态 提交于 2021-01-25 07:10:43
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 9 months ago . Improve this question I have already read the question "rm -rf" equivalent for Windows?. And I have also tried the following commands: $ rm app $ rmdir /s /q app $ rmdir -s -q app $ rd /s /q app and many other variations. It always prompts me with: The item at C:

“rm -rf” equivalent for Windows PowerShell? [closed]

柔情痞子 提交于 2021-01-25 07:09:07
问题 Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 9 months ago . Improve this question I have already read the question "rm -rf" equivalent for Windows?. And I have also tried the following commands: $ rm app $ rmdir /s /q app $ rmdir -s -q app $ rd /s /q app and many other variations. It always prompts me with: The item at C: