25 October, 2023

Powershell Notes

if (-not (...)) {

try {
  Write-Host 'Hello World'
} catch {
  Write-Output 'Something went wrong'

What is the difference between Write-Host and Write-Output?

Use Invoke-WebRequest or curl as alias. Here is an example with 'Host' header for accessing a virtual host. The web-server does return the contents of 'lili.tea.ch' and not the content of 'tea.ch'.

curl -H @{Host='lili.tea.ch'} https://tea.ch


-Method Post