EN VI
Posts (0)
Questions (10)
2024-03-10 13:30:04
Your pattern is almost fine, it can be simplified: $string = @' whatever -----BEGIN PRIVATE KEY----- DANBgkqhkiG9w0BFQEFAASCBKkwggSlAgEA DANBgkqhkiG9w0BFQEFAASCBKkwggSlAgEA DANBgkqhkiG9w0BFQEFAASCBKkw...
Tags: regex powershell
2024-03-11 05:30:07
Remove enabledelayedexpansion from your setlocal statement. In other words: Replace line setlocal enabledelayedexpansion with just setlocal enabledelayedexpansion is what "eats" the ! characters -...
Tags: powershell jenkins
2024-03-12 00:00:11
Note: this is based on the presumption there will not be more than 1 Destination Directory with the same 6-characters prefix $SourceDirectory = 'C:\Directory\Source' $DestinationDirectory = 'C:\Direct...
Tags: powershell
2024-03-13 01:30:07
Try following $inputFilename = 'c:\temp\test.txt' $outputFilename = 'c:\temp\test.csv' $headerRowsCount = 5 $dataRows = 4 $reader = [System.IO.StreamReader]::New($inputFilename) $headerRows = @() $ro...
Tags: powershell
2024-03-13 02:30:06
You'll probably cover most use cases by simply testing whether the input value is either a [string], a [decimal], a [bigint], or of a primitive value type (eg. [int], [byte], [char], etc.): $collect |...
Tags: powershell
2024-03-13 08:30:04
.Split uses the public string[] Split(params char[] separator); overload by default, in your example this means that the ', ###, ' is first converted to a char array [char[]] ', ###, ' and then split...
Tags: powershell split substring
2024-03-14 21:00:09
The general answer to your question is to append redirection 2>&1 to your curl.exe call, causing PowerShell to capture stderr output too (which is where curl.exe prints its progress and verbose infor...
Tags: powershell variables curl
2024-03-15 05:30:06
Because the ArgumentCompleter scriptblock has no knowledge about the Module it is being invoked in, thus has no knowledge about variables defined in the module scope. A simple way to prove this is the...
Tags: powershell module scope
2024-03-15 22:30:10
Presumably you're looking for completion of .tex files in the current location without the .\ in which case you can use Register-ArgumentCompleter with the -Native switch: Register-ArgumentCompleter -...
2024-03-17 20:00:07
Assuming that DesiredState too refers to a property of each input object, replace Where ActualState -ne DesiredState with: Where { $_.ActualState -ne $_.DesiredState } Your attempt to use simplified...

Login


Forgot Your Password?

Create Account


Lost your password? Please enter your email address. You will receive a link to create a new password.

Reset Password

Back to login