Search notes:

PowerShell: The automatic variable $PWD

$pwd stands for present (as in current) working directory.
The type of $pwd is System.Management.Automation.PathInfo.

$pwd and Directory.CurrentWorkingDirectory

The values of $pwd and GetCurrentDirectory() (class system.IO.Directory) are not necessarily the same:
PS: C:\Users\Rene\AppData\Local\Temp> $pwd

Path
----
C:\Users\Rene\AppData\Local\Temp


PS: C:\Users\Rene\AppData\Local\Temp> [System.IO.Directory]::GetCurrentDirectory()
C:\Users\Rene
The reasons are

See also

Typically, $executionContext.SessionState.Path.CurrentLocation has the same value like $pwd, but is read-only, while $pwd is writable.
pwd (not $pwd) is an alias for the get-location cmdLet
$home points to the home directory.
Other automatic variables

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Windows/...', 1745354699, '18.224.21.26', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/PowerShell/language/variable/automatic/pwd(67): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78