1. powershell -ep bypass .\\script.ps1.
  2. powershell -WindoStyle .\\script.ps1.
  3. powershell -NoProfile .\\script.ps1. are essientially scripts that run when the powershell executable is launched and can interfere with our operations.
  4. powershell -Version.
  5. powershell -ec - Encodebase64
  6. PS: get-help Get-Process -Full.
  7. PS: get-help Get-Process -Examples.
  8. PS: get-command -Name *Firewall*.
  9. PS: Get-WmiObject -class win32_operationgsystem | select -Property *.
  10. PS: Get-WmiObject -class win32_operationgsystem | fl *.
  11. PS: Get-WmiObject -class win32_operationgsystem | fl * | Export-Csv C:\\host_info.csv.
  12. PS: cd HKLM:\\- interact with registry directly.
  13. PS: Select-String -Path C:\\users\\user\\documents\\*.txt -Pattern pass*.
  14. PS: Get-Content.
  15. PS: ls -r C:\\users\\user\\documents\\ -File .txt | % {sls -Path $_ -Pattern * }. % for each , $_ for current value in the pipe. sls for select-string.
  16. PS: get-service 's*' | sort-object status -Descending

Powershell Modules.

  1. usually named after .psm1 file extension.
  2. Can contains components like :
    1. any number of powershell script.
    2. Additional Assemblies, help files, scripts
    3. A module manifest file.
    4. A directory which is used to contain all the above.