Skip to content

Latest commit

 

History

History
41 lines (32 loc) · 1.53 KB

pwsh-help.md

File metadata and controls

41 lines (32 loc) · 1.53 KB

Useful Powershell commands

  • show .net assembly manifest

    • ([system.reflection.assembly]::loadfile("C:\code\Kno2\src\Inofile.Worker\bin\Debug\Microsoft.Extensions.Logging.Abstractions.dll")).FullName
  • show environment variables

    • Get-ChildItem Env:
  • show entries in PATH variable

    • `$env-path -split ";"
  • list events of system restart from event log

  • show version of PowerShell

    • get-host
  • find text in files in current folder, recursive

    • Get-ChildItem -Recurse | Select-String "dummy" -List | Select Path

Environment Variables

  • Show vars (sort by name)
    • get-childitem -path env:* | sort-object name
  • Add var
    • $Env:[varname] = "[varvalue]"
  • Remove var
    • [Environment]::SetEnvironmentVariable("[varname]", $null, "Machine")

Config