Search notes:

PowerShell: the automatic variable $args

$args is an array that is used:

Undeclared function parameters

$args is populated in functions for undeclared parameters.
function fOne {
   write-host "`$args.length = $($args.length)"
}

function fTwo($p1, $p2) {
   write-host "`$args.length = $($args.length)"
}

fOne
#
#  $args.length = 0

fOne foo
#
#  $args.length = 1

fOne bar baz
#
#  $args.length = 2

fTwo 42 'hello world'
#
#  $args.length = 0

fTwo A B excess parameters
#
#  $args.length = 2
Github repository about-PowerShell, path: /language/variable/automatic/args/parameters.ps1

See also

Some investigations on passing arrays as arguments to executables and PowerShells scripts.
The influence of System.Management.Automation.CmdletBindingAttribute
Other automatic variables (especially $input.

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/...', 1745370171, '160.79.111.164', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Windows/PowerShell/language/variable/automatic/args/index(80): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78