Skip to content

Instantly share code, notes, and snippets.

@bielawb
Created June 23, 2020 23:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bielawb/208c5788581bb921f531fae7d5db1c42 to your computer and use it in GitHub Desktop.
Save bielawb/208c5788581bb921f531fae7d5db1c42 to your computer and use it in GitHub Desktop.
Analiza pliku przy pomocy switch z parametrami File i Regex
switch -Regex -File C:\Windows\system32\drivers\etc\hosts {
^\s*# {
"Komentarz: [$_]"
}
^\s*$ {
"Pusta linia: [$_]"
}
default {
"Coś tu mamy: [$_]"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment