Skip to content

Instantly share code, notes, and snippets.

@pashalvov
Created March 28, 2022 15:32
Show Gist options
  • Save pashalvov/64607dcc7f428091ee4d7acefb5aa3f1 to your computer and use it in GitHub Desktop.
Save pashalvov/64607dcc7f428091ee4d7acefb5aa3f1 to your computer and use it in GitHub Desktop.
### Хотим чтобы консолько балакала по аглицки
[System.Console]::OutputEncoding = [System.Text.Encoding]::UTF8
### Парсим
$DataOutput = (((quser) -replace '^>', '') -replace '\s{2,}', ',').Trim() | ForEach-Object {
if ($_.Split(',').Count -eq 5) {
Write-Output ($_ -replace '(^[^,]+)', '$1,')
} else {
Write-Output $_
}
} | ConvertFrom-Csv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment