PSScriptRoot

suggest change
Get-ChildItem -Path $PSScriptRoot

This example retrieves the list of child items (directories and files) from the folder where the script file resides.

The $PSScriptRoot automatic variable is $null if used from outside a PowerShell code file. If used inside a PowerShell script, it automatically defined the fully-qualified filesystem path to the directory that contains the script file.

In Windows PowerShell 2.0, this variable is valid only in script modules (.psm1). Beginning in Windows PowerShell 3.0, it is valid in all scripts.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:


Built-in variables:
* PSScriptRoot
* Args
* PSItem
*
* error

Table Of Contents
1 Loops
19 XML
22 Strings
25 Aliases
47 MongoDB
56 Built-in variables
65 AWS S3