Quantcast
Channel: PowerShell – azurecurve
Viewing all articles
Browse latest Browse all 27

PowerShell Snippets: Get Numeric Value from String

$
0
0
PowerShellThis post is part of the series on PowerShell Snippets.

In the previous post, I showed how a single element could be retrieved from a GitHub release by executing curl and selecting the required element.

I quickly discovered that the element retrieved in this was contained some additional characters and I needed only the numeric ones. The PowerShell below will extract the numeric elements of the $id variable and return them in the $releaseID variable:

$releaseID = $id -replace "[^0-9]" , ''

Read original post PowerShell Snippets: Get Numeric Value from String at azurecurve|Ramblings of an IT Professional


Viewing all articles
Browse latest Browse all 27

Trending Articles