From d109a21e5d61617a6066052a59830ef7bf2e185e Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 20 May 2019 15:08:05 -0700 Subject: [PATCH 1/5] Fix #4105 - explain wildcard execution (globbing) --- .../About/about_Command_Precedence.md | 61 +++++++++++++++++- .../About/about_Command_Precedence.md | 62 +++++++++++++++++-- .../About/about_Command_Precedence.md | 62 +++++++++++++++++-- .../About/about_Command_Precedence.md | 62 +++++++++++++++++-- .../About/about_Command_Precedence.md | 61 +++++++++++++++++- 5 files changed, 290 insertions(+), 18 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index bfa89ffcd4ef..6ff584df0769 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -18,7 +18,7 @@ within a session can be hidden or replaced by commands with the same name. This article shows you how to run hidden commands and how to avoid command-name conflicts. -## Command precedence +## Command path precedence When a PowerShell session includes more than one command that has the same name, PowerShell determines which command to run by using the @@ -48,8 +48,63 @@ following rules. .\FindDocs.ps1 ``` -- If you do not specify a path, PowerShell uses the following precedence order - when it runs commands: +### Using wildcards in execution + +You may use wildcards in command execution. Using wildcard characters is +also known as *globbing*. + +PowerShell will execute a file that has a wildcard match, before a literal +match. + +For example, consider a directory with the following files: + +``` +PS C:\temp\test> Get-ChildItem + + + Directory: C:\temp\test + + +Mode LastWriteTime Length Name +---- ------------- ------ ---- +-a---- 5/20/2019 2:29 PM 28 a.ps1 +-a---- 5/20/2019 2:29 PM 28 [a1].ps1 +``` + +Both script files have the same content: `$MyInvocation.MyCommand.Path`. +This command displays the name of the script that is invoked. + +When you run `[a1].ps1`, the file `a.ps1` is executed even though the file +`[a1].ps1` is a literal match. + +```powershell +C:\temp\test\[a1].ps1 +``` + +```Output +C:\temp\test\a.ps1 +``` + +Now lets delete the `a.ps1` file and attempt to run it again. + +```powershell +Remove-Item a.ps1 +C:\temp\test\[a1].ps1 +``` + +```Output +C:\temp\test\[a1].ps1 +``` + +You can see from the output that `[a1].ps1` runs this time because the literal +match is the only file match for that wildcard pattern. + +For more information about how PowerShell uses wildcards, see [about_Wildcards](about_Wildcards.md). + +## Command precedence + +If you do not specify a path, PowerShell uses the following precedence order +when it runs commands: 1. Alias 2. Function diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index bfa89ffcd4ef..3ea594a3b06e 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -7,7 +7,6 @@ title: about_Command_Precedence # About Command Precedence ## Short description - Describes how PowerShell determines which command to run. ## Long description @@ -18,7 +17,7 @@ within a session can be hidden or replaced by commands with the same name. This article shows you how to run hidden commands and how to avoid command-name conflicts. -## Command precedence +## Command path precedence When a PowerShell session includes more than one command that has the same name, PowerShell determines which command to run by using the @@ -48,8 +47,63 @@ following rules. .\FindDocs.ps1 ``` -- If you do not specify a path, PowerShell uses the following precedence order - when it runs commands: +### Using wildcards in execution + +You may use wildcards in command execution. Using wildcard characters is +also known as *globbing*. + +PowerShell will execute a file that has a wildcard match, before a literal +match. + +For example, consider a directory with the following files: + +``` +PS C:\temp\test> Get-ChildItem + + + Directory: C:\temp\test + + +Mode LastWriteTime Length Name +---- ------------- ------ ---- +-a---- 5/20/2019 2:29 PM 28 a.ps1 +-a---- 5/20/2019 2:29 PM 28 [a1].ps1 +``` + +Both script files have the same content: `$MyInvocation.MyCommand.Path`. +This command displays the name of the script that is invoked. + +When you run `[a1].ps1`, the file `a.ps1` is executed even though the file +`[a1].ps1` is a literal match. + +```powershell +C:\temp\test\[a1].ps1 +``` + +```Output +C:\temp\test\a.ps1 +``` + +Now lets delete the `a.ps1` file and attempt to run it again. + +```powershell +Remove-Item a.ps1 +C:\temp\test\[a1].ps1 +``` + +```Output +C:\temp\test\[a1].ps1 +``` + +You can see from the output that `[a1].ps1` runs this time because the literal +match is the only file match for that wildcard pattern. + +For more information about how PowerShell uses wildcards, see [about_Wildcards](about_Wildcards.md). + +## Command precedence + +If you do not specify a path, PowerShell uses the following precedence order +when it runs commands: 1. Alias 2. Function diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index bfa89ffcd4ef..3ea594a3b06e 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -7,7 +7,6 @@ title: about_Command_Precedence # About Command Precedence ## Short description - Describes how PowerShell determines which command to run. ## Long description @@ -18,7 +17,7 @@ within a session can be hidden or replaced by commands with the same name. This article shows you how to run hidden commands and how to avoid command-name conflicts. -## Command precedence +## Command path precedence When a PowerShell session includes more than one command that has the same name, PowerShell determines which command to run by using the @@ -48,8 +47,63 @@ following rules. .\FindDocs.ps1 ``` -- If you do not specify a path, PowerShell uses the following precedence order - when it runs commands: +### Using wildcards in execution + +You may use wildcards in command execution. Using wildcard characters is +also known as *globbing*. + +PowerShell will execute a file that has a wildcard match, before a literal +match. + +For example, consider a directory with the following files: + +``` +PS C:\temp\test> Get-ChildItem + + + Directory: C:\temp\test + + +Mode LastWriteTime Length Name +---- ------------- ------ ---- +-a---- 5/20/2019 2:29 PM 28 a.ps1 +-a---- 5/20/2019 2:29 PM 28 [a1].ps1 +``` + +Both script files have the same content: `$MyInvocation.MyCommand.Path`. +This command displays the name of the script that is invoked. + +When you run `[a1].ps1`, the file `a.ps1` is executed even though the file +`[a1].ps1` is a literal match. + +```powershell +C:\temp\test\[a1].ps1 +``` + +```Output +C:\temp\test\a.ps1 +``` + +Now lets delete the `a.ps1` file and attempt to run it again. + +```powershell +Remove-Item a.ps1 +C:\temp\test\[a1].ps1 +``` + +```Output +C:\temp\test\[a1].ps1 +``` + +You can see from the output that `[a1].ps1` runs this time because the literal +match is the only file match for that wildcard pattern. + +For more information about how PowerShell uses wildcards, see [about_Wildcards](about_Wildcards.md). + +## Command precedence + +If you do not specify a path, PowerShell uses the following precedence order +when it runs commands: 1. Alias 2. Function diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index bfa89ffcd4ef..3ea594a3b06e 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -7,7 +7,6 @@ title: about_Command_Precedence # About Command Precedence ## Short description - Describes how PowerShell determines which command to run. ## Long description @@ -18,7 +17,7 @@ within a session can be hidden or replaced by commands with the same name. This article shows you how to run hidden commands and how to avoid command-name conflicts. -## Command precedence +## Command path precedence When a PowerShell session includes more than one command that has the same name, PowerShell determines which command to run by using the @@ -48,8 +47,63 @@ following rules. .\FindDocs.ps1 ``` -- If you do not specify a path, PowerShell uses the following precedence order - when it runs commands: +### Using wildcards in execution + +You may use wildcards in command execution. Using wildcard characters is +also known as *globbing*. + +PowerShell will execute a file that has a wildcard match, before a literal +match. + +For example, consider a directory with the following files: + +``` +PS C:\temp\test> Get-ChildItem + + + Directory: C:\temp\test + + +Mode LastWriteTime Length Name +---- ------------- ------ ---- +-a---- 5/20/2019 2:29 PM 28 a.ps1 +-a---- 5/20/2019 2:29 PM 28 [a1].ps1 +``` + +Both script files have the same content: `$MyInvocation.MyCommand.Path`. +This command displays the name of the script that is invoked. + +When you run `[a1].ps1`, the file `a.ps1` is executed even though the file +`[a1].ps1` is a literal match. + +```powershell +C:\temp\test\[a1].ps1 +``` + +```Output +C:\temp\test\a.ps1 +``` + +Now lets delete the `a.ps1` file and attempt to run it again. + +```powershell +Remove-Item a.ps1 +C:\temp\test\[a1].ps1 +``` + +```Output +C:\temp\test\[a1].ps1 +``` + +You can see from the output that `[a1].ps1` runs this time because the literal +match is the only file match for that wildcard pattern. + +For more information about how PowerShell uses wildcards, see [about_Wildcards](about_Wildcards.md). + +## Command precedence + +If you do not specify a path, PowerShell uses the following precedence order +when it runs commands: 1. Alias 2. Function diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/6/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index d8cab1f0a5f2..3ea594a3b06e 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -17,7 +17,7 @@ within a session can be hidden or replaced by commands with the same name. This article shows you how to run hidden commands and how to avoid command-name conflicts. -## Command precedence +## Command path precedence When a PowerShell session includes more than one command that has the same name, PowerShell determines which command to run by using the @@ -47,8 +47,63 @@ following rules. .\FindDocs.ps1 ``` -- If you do not specify a path, PowerShell uses the following precedence order - when it runs commands: +### Using wildcards in execution + +You may use wildcards in command execution. Using wildcard characters is +also known as *globbing*. + +PowerShell will execute a file that has a wildcard match, before a literal +match. + +For example, consider a directory with the following files: + +``` +PS C:\temp\test> Get-ChildItem + + + Directory: C:\temp\test + + +Mode LastWriteTime Length Name +---- ------------- ------ ---- +-a---- 5/20/2019 2:29 PM 28 a.ps1 +-a---- 5/20/2019 2:29 PM 28 [a1].ps1 +``` + +Both script files have the same content: `$MyInvocation.MyCommand.Path`. +This command displays the name of the script that is invoked. + +When you run `[a1].ps1`, the file `a.ps1` is executed even though the file +`[a1].ps1` is a literal match. + +```powershell +C:\temp\test\[a1].ps1 +``` + +```Output +C:\temp\test\a.ps1 +``` + +Now lets delete the `a.ps1` file and attempt to run it again. + +```powershell +Remove-Item a.ps1 +C:\temp\test\[a1].ps1 +``` + +```Output +C:\temp\test\[a1].ps1 +``` + +You can see from the output that `[a1].ps1` runs this time because the literal +match is the only file match for that wildcard pattern. + +For more information about how PowerShell uses wildcards, see [about_Wildcards](about_Wildcards.md). + +## Command precedence + +If you do not specify a path, PowerShell uses the following precedence order +when it runs commands: 1. Alias 2. Function From 44f6e01e918887e48fce561c3de3459ec77a0803 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 20 May 2019 15:45:36 -0700 Subject: [PATCH 2/5] review feedback --- .../About/about_Command_Precedence.md | 15 +++++++++------ .../About/about_Command_Precedence.md | 14 +++++++++----- .../About/about_Command_Precedence.md | 14 +++++++++----- .../About/about_Command_Precedence.md | 14 +++++++++----- .../About/about_Command_Precedence.md | 14 +++++++++----- 5 files changed, 45 insertions(+), 26 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index 6ff584df0769..b05ef1467ae3 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -7,7 +7,6 @@ title: about_Command_Precedence # About Command Precedence ## Short description - Describes how PowerShell determines which command to run. ## Long description @@ -18,7 +17,7 @@ within a session can be hidden or replaced by commands with the same name. This article shows you how to run hidden commands and how to avoid command-name conflicts. -## Command path precedence +## Command precedence When a PowerShell session includes more than one command that has the same name, PowerShell determines which command to run by using the @@ -40,7 +39,7 @@ following rules. path to the script file. To run a script that is in the current directory, specify the full path, or - type a dot `.` to represent the current directory. + type a dot `.\` to represent the current directory. For example, to run the FindDocs.ps1 file in the current directory, type: @@ -59,7 +58,7 @@ match. For example, consider a directory with the following files: ``` -PS C:\temp\test> Get-ChildItem +Get-ChildItem C:\temp\test Directory: C:\temp\test @@ -88,7 +87,7 @@ C:\temp\test\a.ps1 Now lets delete the `a.ps1` file and attempt to run it again. ```powershell -Remove-Item a.ps1 +Remove-Item C:\temp\test\a.ps1 C:\temp\test\[a1].ps1 ``` @@ -101,7 +100,11 @@ match is the only file match for that wildcard pattern. For more information about how PowerShell uses wildcards, see [about_Wildcards](about_Wildcards.md). -## Command precedence +> [!NOTE] +> To limit the search to a relative path, you must prefix the script name with +> the relative folder name. This limits the search for commands to files in +> that folder. Without this prefix, other PowerShell syntax may conflict and +> there are few guarantees that the file will be found. If you do not specify a path, PowerShell uses the following precedence order when it runs commands: diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index 3ea594a3b06e..b05ef1467ae3 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -17,7 +17,7 @@ within a session can be hidden or replaced by commands with the same name. This article shows you how to run hidden commands and how to avoid command-name conflicts. -## Command path precedence +## Command precedence When a PowerShell session includes more than one command that has the same name, PowerShell determines which command to run by using the @@ -39,7 +39,7 @@ following rules. path to the script file. To run a script that is in the current directory, specify the full path, or - type a dot `.` to represent the current directory. + type a dot `.\` to represent the current directory. For example, to run the FindDocs.ps1 file in the current directory, type: @@ -58,7 +58,7 @@ match. For example, consider a directory with the following files: ``` -PS C:\temp\test> Get-ChildItem +Get-ChildItem C:\temp\test Directory: C:\temp\test @@ -87,7 +87,7 @@ C:\temp\test\a.ps1 Now lets delete the `a.ps1` file and attempt to run it again. ```powershell -Remove-Item a.ps1 +Remove-Item C:\temp\test\a.ps1 C:\temp\test\[a1].ps1 ``` @@ -100,7 +100,11 @@ match is the only file match for that wildcard pattern. For more information about how PowerShell uses wildcards, see [about_Wildcards](about_Wildcards.md). -## Command precedence +> [!NOTE] +> To limit the search to a relative path, you must prefix the script name with +> the relative folder name. This limits the search for commands to files in +> that folder. Without this prefix, other PowerShell syntax may conflict and +> there are few guarantees that the file will be found. If you do not specify a path, PowerShell uses the following precedence order when it runs commands: diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index 3ea594a3b06e..b05ef1467ae3 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -17,7 +17,7 @@ within a session can be hidden or replaced by commands with the same name. This article shows you how to run hidden commands and how to avoid command-name conflicts. -## Command path precedence +## Command precedence When a PowerShell session includes more than one command that has the same name, PowerShell determines which command to run by using the @@ -39,7 +39,7 @@ following rules. path to the script file. To run a script that is in the current directory, specify the full path, or - type a dot `.` to represent the current directory. + type a dot `.\` to represent the current directory. For example, to run the FindDocs.ps1 file in the current directory, type: @@ -58,7 +58,7 @@ match. For example, consider a directory with the following files: ``` -PS C:\temp\test> Get-ChildItem +Get-ChildItem C:\temp\test Directory: C:\temp\test @@ -87,7 +87,7 @@ C:\temp\test\a.ps1 Now lets delete the `a.ps1` file and attempt to run it again. ```powershell -Remove-Item a.ps1 +Remove-Item C:\temp\test\a.ps1 C:\temp\test\[a1].ps1 ``` @@ -100,7 +100,11 @@ match is the only file match for that wildcard pattern. For more information about how PowerShell uses wildcards, see [about_Wildcards](about_Wildcards.md). -## Command precedence +> [!NOTE] +> To limit the search to a relative path, you must prefix the script name with +> the relative folder name. This limits the search for commands to files in +> that folder. Without this prefix, other PowerShell syntax may conflict and +> there are few guarantees that the file will be found. If you do not specify a path, PowerShell uses the following precedence order when it runs commands: diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index 3ea594a3b06e..b05ef1467ae3 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -17,7 +17,7 @@ within a session can be hidden or replaced by commands with the same name. This article shows you how to run hidden commands and how to avoid command-name conflicts. -## Command path precedence +## Command precedence When a PowerShell session includes more than one command that has the same name, PowerShell determines which command to run by using the @@ -39,7 +39,7 @@ following rules. path to the script file. To run a script that is in the current directory, specify the full path, or - type a dot `.` to represent the current directory. + type a dot `.\` to represent the current directory. For example, to run the FindDocs.ps1 file in the current directory, type: @@ -58,7 +58,7 @@ match. For example, consider a directory with the following files: ``` -PS C:\temp\test> Get-ChildItem +Get-ChildItem C:\temp\test Directory: C:\temp\test @@ -87,7 +87,7 @@ C:\temp\test\a.ps1 Now lets delete the `a.ps1` file and attempt to run it again. ```powershell -Remove-Item a.ps1 +Remove-Item C:\temp\test\a.ps1 C:\temp\test\[a1].ps1 ``` @@ -100,7 +100,11 @@ match is the only file match for that wildcard pattern. For more information about how PowerShell uses wildcards, see [about_Wildcards](about_Wildcards.md). -## Command precedence +> [!NOTE] +> To limit the search to a relative path, you must prefix the script name with +> the relative folder name. This limits the search for commands to files in +> that folder. Without this prefix, other PowerShell syntax may conflict and +> there are few guarantees that the file will be found. If you do not specify a path, PowerShell uses the following precedence order when it runs commands: diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/6/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index 3ea594a3b06e..b05ef1467ae3 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -17,7 +17,7 @@ within a session can be hidden or replaced by commands with the same name. This article shows you how to run hidden commands and how to avoid command-name conflicts. -## Command path precedence +## Command precedence When a PowerShell session includes more than one command that has the same name, PowerShell determines which command to run by using the @@ -39,7 +39,7 @@ following rules. path to the script file. To run a script that is in the current directory, specify the full path, or - type a dot `.` to represent the current directory. + type a dot `.\` to represent the current directory. For example, to run the FindDocs.ps1 file in the current directory, type: @@ -58,7 +58,7 @@ match. For example, consider a directory with the following files: ``` -PS C:\temp\test> Get-ChildItem +Get-ChildItem C:\temp\test Directory: C:\temp\test @@ -87,7 +87,7 @@ C:\temp\test\a.ps1 Now lets delete the `a.ps1` file and attempt to run it again. ```powershell -Remove-Item a.ps1 +Remove-Item C:\temp\test\a.ps1 C:\temp\test\[a1].ps1 ``` @@ -100,7 +100,11 @@ match is the only file match for that wildcard pattern. For more information about how PowerShell uses wildcards, see [about_Wildcards](about_Wildcards.md). -## Command precedence +> [!NOTE] +> To limit the search to a relative path, you must prefix the script name with +> the relative folder name. This limits the search for commands to files in +> that folder. Without this prefix, other PowerShell syntax may conflict and +> there are few guarantees that the file will be found. If you do not specify a path, PowerShell uses the following precedence order when it runs commands: From 5ab17d308477d17fcdeb0b50eb162a94690b83a7 Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 20 May 2019 16:19:28 -0700 Subject: [PATCH 3/5] more review feedback --- .../About/about_Command_Precedence.md | 64 +++++++++---------- .../About/about_Command_Precedence.md | 64 +++++++++---------- .../About/about_Command_Precedence.md | 64 +++++++++---------- .../About/about_Command_Precedence.md | 64 +++++++++---------- .../About/about_Command_Precedence.md | 64 +++++++++---------- 5 files changed, 155 insertions(+), 165 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index b05ef1467ae3..6f128910737c 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -1,5 +1,5 @@ --- -ms.date: 08/28/2018 +ms.date: 05/20/2019 schema: 2.0.0 keywords: powershell,cmdlet title: about_Command_Precedence @@ -19,41 +19,39 @@ command-name conflicts. ## Command precedence -When a PowerShell session includes more than one command that has the -same name, PowerShell determines which command to run by using the -following rules. +When a PowerShell session includes more than one command that has the same +name, PowerShell determines which command to run by using the following rules. -- If you specify the path to a command, PowerShell runs the command at the - location specified by the path. +If you specify the path to a command, PowerShell runs the command at the +location specified by the path. - For example, the following command runs the FindDocs.ps1 script in the - "C:\\TechDocs" directory: +For example, the following command runs the FindDocs.ps1 script in the +"C:\\TechDocs" directory: - ``` - C:\TechDocs\FindDocs.ps1 - ``` +``` +C:\TechDocs\FindDocs.ps1 +``` - As a security feature, PowerShell does not run executable (native) commands, - including PowerShell scripts, unless the command is located in a path that is - listed in the Path environment variable `$env:path` or unless you specify the - path to the script file. +As a security feature, PowerShell does not run executable (native) commands, +including PowerShell scripts, unless the command is located in a path that is +listed in the Path environment variable `$env:path` or unless you specify the +path to the script file. - To run a script that is in the current directory, specify the full path, or - type a dot `.\` to represent the current directory. +To run a script that is in the current directory, specify the full path, or +type a dot `.\` to represent the current directory. - For example, to run the FindDocs.ps1 file in the current directory, type: +For example, to run the FindDocs.ps1 file in the current directory, type: - ``` - .\FindDocs.ps1 - ``` +``` +.\FindDocs.ps1 +``` ### Using wildcards in execution You may use wildcards in command execution. Using wildcard characters is also known as *globbing*. -PowerShell will execute a file that has a wildcard match, before a literal -match. +PowerShell executes a file that has a wildcard match, before a literal match. For example, consider a directory with the following files: @@ -84,7 +82,7 @@ C:\temp\test\[a1].ps1 C:\temp\test\a.ps1 ``` -Now lets delete the `a.ps1` file and attempt to run it again. +Now let's delete the `a.ps1` file and attempt to run it again. ```powershell Remove-Item C:\temp\test\a.ps1 @@ -114,18 +112,18 @@ when it runs commands: 3. Cmdlet 4. Native Windows commands - Therefore, if you type "help", PowerShell first looks for an alias named - `help`, then a function named `Help`, and finally a cmdlet named `Help`. It - runs the first `help` item that it finds. +Therefore, if you type "help", PowerShell first looks for an alias named +`help`, then a function named `Help`, and finally a cmdlet named `Help`. It +runs the first `help` item that it finds. - For example, if your session contains a cmdlet and a function, both named - `Get-Map`, when you type `Get-Map`, PowerShell runs the function. +For example, if your session contains a cmdlet and a function, both named +`Get-Map`, when you type `Get-Map`, PowerShell runs the function. - When the session contains items of the same type that have the same name, - PowerShell runs the newer item. +When the session contains items of the same type that have the same name, +PowerShell runs the newer item. - For example, if you import another `Get-Date` cmdlet from a module, when you - type `Get-Date`, PowerShell runs the imported version over the native one. +For example, if you import another `Get-Date` cmdlet from a module, when you +type `Get-Date`, PowerShell runs the imported version over the native one. ## Hidden and replaced items diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index b05ef1467ae3..6f128910737c 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -1,5 +1,5 @@ --- -ms.date: 08/28/2018 +ms.date: 05/20/2019 schema: 2.0.0 keywords: powershell,cmdlet title: about_Command_Precedence @@ -19,41 +19,39 @@ command-name conflicts. ## Command precedence -When a PowerShell session includes more than one command that has the -same name, PowerShell determines which command to run by using the -following rules. +When a PowerShell session includes more than one command that has the same +name, PowerShell determines which command to run by using the following rules. -- If you specify the path to a command, PowerShell runs the command at the - location specified by the path. +If you specify the path to a command, PowerShell runs the command at the +location specified by the path. - For example, the following command runs the FindDocs.ps1 script in the - "C:\\TechDocs" directory: +For example, the following command runs the FindDocs.ps1 script in the +"C:\\TechDocs" directory: - ``` - C:\TechDocs\FindDocs.ps1 - ``` +``` +C:\TechDocs\FindDocs.ps1 +``` - As a security feature, PowerShell does not run executable (native) commands, - including PowerShell scripts, unless the command is located in a path that is - listed in the Path environment variable `$env:path` or unless you specify the - path to the script file. +As a security feature, PowerShell does not run executable (native) commands, +including PowerShell scripts, unless the command is located in a path that is +listed in the Path environment variable `$env:path` or unless you specify the +path to the script file. - To run a script that is in the current directory, specify the full path, or - type a dot `.\` to represent the current directory. +To run a script that is in the current directory, specify the full path, or +type a dot `.\` to represent the current directory. - For example, to run the FindDocs.ps1 file in the current directory, type: +For example, to run the FindDocs.ps1 file in the current directory, type: - ``` - .\FindDocs.ps1 - ``` +``` +.\FindDocs.ps1 +``` ### Using wildcards in execution You may use wildcards in command execution. Using wildcard characters is also known as *globbing*. -PowerShell will execute a file that has a wildcard match, before a literal -match. +PowerShell executes a file that has a wildcard match, before a literal match. For example, consider a directory with the following files: @@ -84,7 +82,7 @@ C:\temp\test\[a1].ps1 C:\temp\test\a.ps1 ``` -Now lets delete the `a.ps1` file and attempt to run it again. +Now let's delete the `a.ps1` file and attempt to run it again. ```powershell Remove-Item C:\temp\test\a.ps1 @@ -114,18 +112,18 @@ when it runs commands: 3. Cmdlet 4. Native Windows commands - Therefore, if you type "help", PowerShell first looks for an alias named - `help`, then a function named `Help`, and finally a cmdlet named `Help`. It - runs the first `help` item that it finds. +Therefore, if you type "help", PowerShell first looks for an alias named +`help`, then a function named `Help`, and finally a cmdlet named `Help`. It +runs the first `help` item that it finds. - For example, if your session contains a cmdlet and a function, both named - `Get-Map`, when you type `Get-Map`, PowerShell runs the function. +For example, if your session contains a cmdlet and a function, both named +`Get-Map`, when you type `Get-Map`, PowerShell runs the function. - When the session contains items of the same type that have the same name, - PowerShell runs the newer item. +When the session contains items of the same type that have the same name, +PowerShell runs the newer item. - For example, if you import another `Get-Date` cmdlet from a module, when you - type `Get-Date`, PowerShell runs the imported version over the native one. +For example, if you import another `Get-Date` cmdlet from a module, when you +type `Get-Date`, PowerShell runs the imported version over the native one. ## Hidden and replaced items diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index b05ef1467ae3..6f128910737c 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -1,5 +1,5 @@ --- -ms.date: 08/28/2018 +ms.date: 05/20/2019 schema: 2.0.0 keywords: powershell,cmdlet title: about_Command_Precedence @@ -19,41 +19,39 @@ command-name conflicts. ## Command precedence -When a PowerShell session includes more than one command that has the -same name, PowerShell determines which command to run by using the -following rules. +When a PowerShell session includes more than one command that has the same +name, PowerShell determines which command to run by using the following rules. -- If you specify the path to a command, PowerShell runs the command at the - location specified by the path. +If you specify the path to a command, PowerShell runs the command at the +location specified by the path. - For example, the following command runs the FindDocs.ps1 script in the - "C:\\TechDocs" directory: +For example, the following command runs the FindDocs.ps1 script in the +"C:\\TechDocs" directory: - ``` - C:\TechDocs\FindDocs.ps1 - ``` +``` +C:\TechDocs\FindDocs.ps1 +``` - As a security feature, PowerShell does not run executable (native) commands, - including PowerShell scripts, unless the command is located in a path that is - listed in the Path environment variable `$env:path` or unless you specify the - path to the script file. +As a security feature, PowerShell does not run executable (native) commands, +including PowerShell scripts, unless the command is located in a path that is +listed in the Path environment variable `$env:path` or unless you specify the +path to the script file. - To run a script that is in the current directory, specify the full path, or - type a dot `.\` to represent the current directory. +To run a script that is in the current directory, specify the full path, or +type a dot `.\` to represent the current directory. - For example, to run the FindDocs.ps1 file in the current directory, type: +For example, to run the FindDocs.ps1 file in the current directory, type: - ``` - .\FindDocs.ps1 - ``` +``` +.\FindDocs.ps1 +``` ### Using wildcards in execution You may use wildcards in command execution. Using wildcard characters is also known as *globbing*. -PowerShell will execute a file that has a wildcard match, before a literal -match. +PowerShell executes a file that has a wildcard match, before a literal match. For example, consider a directory with the following files: @@ -84,7 +82,7 @@ C:\temp\test\[a1].ps1 C:\temp\test\a.ps1 ``` -Now lets delete the `a.ps1` file and attempt to run it again. +Now let's delete the `a.ps1` file and attempt to run it again. ```powershell Remove-Item C:\temp\test\a.ps1 @@ -114,18 +112,18 @@ when it runs commands: 3. Cmdlet 4. Native Windows commands - Therefore, if you type "help", PowerShell first looks for an alias named - `help`, then a function named `Help`, and finally a cmdlet named `Help`. It - runs the first `help` item that it finds. +Therefore, if you type "help", PowerShell first looks for an alias named +`help`, then a function named `Help`, and finally a cmdlet named `Help`. It +runs the first `help` item that it finds. - For example, if your session contains a cmdlet and a function, both named - `Get-Map`, when you type `Get-Map`, PowerShell runs the function. +For example, if your session contains a cmdlet and a function, both named +`Get-Map`, when you type `Get-Map`, PowerShell runs the function. - When the session contains items of the same type that have the same name, - PowerShell runs the newer item. +When the session contains items of the same type that have the same name, +PowerShell runs the newer item. - For example, if you import another `Get-Date` cmdlet from a module, when you - type `Get-Date`, PowerShell runs the imported version over the native one. +For example, if you import another `Get-Date` cmdlet from a module, when you +type `Get-Date`, PowerShell runs the imported version over the native one. ## Hidden and replaced items diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index b05ef1467ae3..6f128910737c 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -1,5 +1,5 @@ --- -ms.date: 08/28/2018 +ms.date: 05/20/2019 schema: 2.0.0 keywords: powershell,cmdlet title: about_Command_Precedence @@ -19,41 +19,39 @@ command-name conflicts. ## Command precedence -When a PowerShell session includes more than one command that has the -same name, PowerShell determines which command to run by using the -following rules. +When a PowerShell session includes more than one command that has the same +name, PowerShell determines which command to run by using the following rules. -- If you specify the path to a command, PowerShell runs the command at the - location specified by the path. +If you specify the path to a command, PowerShell runs the command at the +location specified by the path. - For example, the following command runs the FindDocs.ps1 script in the - "C:\\TechDocs" directory: +For example, the following command runs the FindDocs.ps1 script in the +"C:\\TechDocs" directory: - ``` - C:\TechDocs\FindDocs.ps1 - ``` +``` +C:\TechDocs\FindDocs.ps1 +``` - As a security feature, PowerShell does not run executable (native) commands, - including PowerShell scripts, unless the command is located in a path that is - listed in the Path environment variable `$env:path` or unless you specify the - path to the script file. +As a security feature, PowerShell does not run executable (native) commands, +including PowerShell scripts, unless the command is located in a path that is +listed in the Path environment variable `$env:path` or unless you specify the +path to the script file. - To run a script that is in the current directory, specify the full path, or - type a dot `.\` to represent the current directory. +To run a script that is in the current directory, specify the full path, or +type a dot `.\` to represent the current directory. - For example, to run the FindDocs.ps1 file in the current directory, type: +For example, to run the FindDocs.ps1 file in the current directory, type: - ``` - .\FindDocs.ps1 - ``` +``` +.\FindDocs.ps1 +``` ### Using wildcards in execution You may use wildcards in command execution. Using wildcard characters is also known as *globbing*. -PowerShell will execute a file that has a wildcard match, before a literal -match. +PowerShell executes a file that has a wildcard match, before a literal match. For example, consider a directory with the following files: @@ -84,7 +82,7 @@ C:\temp\test\[a1].ps1 C:\temp\test\a.ps1 ``` -Now lets delete the `a.ps1` file and attempt to run it again. +Now let's delete the `a.ps1` file and attempt to run it again. ```powershell Remove-Item C:\temp\test\a.ps1 @@ -114,18 +112,18 @@ when it runs commands: 3. Cmdlet 4. Native Windows commands - Therefore, if you type "help", PowerShell first looks for an alias named - `help`, then a function named `Help`, and finally a cmdlet named `Help`. It - runs the first `help` item that it finds. +Therefore, if you type "help", PowerShell first looks for an alias named +`help`, then a function named `Help`, and finally a cmdlet named `Help`. It +runs the first `help` item that it finds. - For example, if your session contains a cmdlet and a function, both named - `Get-Map`, when you type `Get-Map`, PowerShell runs the function. +For example, if your session contains a cmdlet and a function, both named +`Get-Map`, when you type `Get-Map`, PowerShell runs the function. - When the session contains items of the same type that have the same name, - PowerShell runs the newer item. +When the session contains items of the same type that have the same name, +PowerShell runs the newer item. - For example, if you import another `Get-Date` cmdlet from a module, when you - type `Get-Date`, PowerShell runs the imported version over the native one. +For example, if you import another `Get-Date` cmdlet from a module, when you +type `Get-Date`, PowerShell runs the imported version over the native one. ## Hidden and replaced items diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/6/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index b05ef1467ae3..6f128910737c 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -1,5 +1,5 @@ --- -ms.date: 08/28/2018 +ms.date: 05/20/2019 schema: 2.0.0 keywords: powershell,cmdlet title: about_Command_Precedence @@ -19,41 +19,39 @@ command-name conflicts. ## Command precedence -When a PowerShell session includes more than one command that has the -same name, PowerShell determines which command to run by using the -following rules. +When a PowerShell session includes more than one command that has the same +name, PowerShell determines which command to run by using the following rules. -- If you specify the path to a command, PowerShell runs the command at the - location specified by the path. +If you specify the path to a command, PowerShell runs the command at the +location specified by the path. - For example, the following command runs the FindDocs.ps1 script in the - "C:\\TechDocs" directory: +For example, the following command runs the FindDocs.ps1 script in the +"C:\\TechDocs" directory: - ``` - C:\TechDocs\FindDocs.ps1 - ``` +``` +C:\TechDocs\FindDocs.ps1 +``` - As a security feature, PowerShell does not run executable (native) commands, - including PowerShell scripts, unless the command is located in a path that is - listed in the Path environment variable `$env:path` or unless you specify the - path to the script file. +As a security feature, PowerShell does not run executable (native) commands, +including PowerShell scripts, unless the command is located in a path that is +listed in the Path environment variable `$env:path` or unless you specify the +path to the script file. - To run a script that is in the current directory, specify the full path, or - type a dot `.\` to represent the current directory. +To run a script that is in the current directory, specify the full path, or +type a dot `.\` to represent the current directory. - For example, to run the FindDocs.ps1 file in the current directory, type: +For example, to run the FindDocs.ps1 file in the current directory, type: - ``` - .\FindDocs.ps1 - ``` +``` +.\FindDocs.ps1 +``` ### Using wildcards in execution You may use wildcards in command execution. Using wildcard characters is also known as *globbing*. -PowerShell will execute a file that has a wildcard match, before a literal -match. +PowerShell executes a file that has a wildcard match, before a literal match. For example, consider a directory with the following files: @@ -84,7 +82,7 @@ C:\temp\test\[a1].ps1 C:\temp\test\a.ps1 ``` -Now lets delete the `a.ps1` file and attempt to run it again. +Now let's delete the `a.ps1` file and attempt to run it again. ```powershell Remove-Item C:\temp\test\a.ps1 @@ -114,18 +112,18 @@ when it runs commands: 3. Cmdlet 4. Native Windows commands - Therefore, if you type "help", PowerShell first looks for an alias named - `help`, then a function named `Help`, and finally a cmdlet named `Help`. It - runs the first `help` item that it finds. +Therefore, if you type "help", PowerShell first looks for an alias named +`help`, then a function named `Help`, and finally a cmdlet named `Help`. It +runs the first `help` item that it finds. - For example, if your session contains a cmdlet and a function, both named - `Get-Map`, when you type `Get-Map`, PowerShell runs the function. +For example, if your session contains a cmdlet and a function, both named +`Get-Map`, when you type `Get-Map`, PowerShell runs the function. - When the session contains items of the same type that have the same name, - PowerShell runs the newer item. +When the session contains items of the same type that have the same name, +PowerShell runs the newer item. - For example, if you import another `Get-Date` cmdlet from a module, when you - type `Get-Date`, PowerShell runs the imported version over the native one. +For example, if you import another `Get-Date` cmdlet from a module, when you +type `Get-Date`, PowerShell runs the imported version over the native one. ## Hidden and replaced items From ce45c13977133138888e832f2001bd934ebf28ab Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 20 May 2019 16:22:49 -0700 Subject: [PATCH 4/5] Update reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md Co-Authored-By: Travis Plunk --- .../About/about_Command_Precedence.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index 6f128910737c..65ffb5127f4f 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -100,7 +100,7 @@ For more information about how PowerShell uses wildcards, see [about_Wildcards]( > [!NOTE] > To limit the search to a relative path, you must prefix the script name with -> the relative folder name. This limits the search for commands to files in +> the `.\`. This limits the search for commands to files in > that folder. Without this prefix, other PowerShell syntax may conflict and > there are few guarantees that the file will be found. @@ -315,4 +315,4 @@ For more information, see `Import-Module` and `Import-PSSession` below. - [Function-Provider](../../Microsoft.PowerShell.Core/About/about_Function_Provider.md) - [Get-Command](../../Microsoft.PowerShell.Core/Get-Command.md) - [Import-Module](../../Microsoft.PowerShell.Core/Import-Module.md) -- [Import-PSSession](../../Microsoft.PowerShell.Utility/Import-PSSession.md) \ No newline at end of file +- [Import-PSSession](../../Microsoft.PowerShell.Utility/Import-PSSession.md) From 34b0bf7bad77a18b484b45c716d08a155616873e Mon Sep 17 00:00:00 2001 From: Sean Wheeler Date: Mon, 20 May 2019 16:26:50 -0700 Subject: [PATCH 5/5] more review feedback --- .../About/about_Command_Precedence.md | 6 +++--- .../About/about_Command_Precedence.md | 6 +++--- .../About/about_Command_Precedence.md | 6 +++--- .../About/about_Command_Precedence.md | 6 +++--- .../About/about_Command_Precedence.md | 6 +++--- 5 files changed, 15 insertions(+), 15 deletions(-) diff --git a/reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index 65ffb5127f4f..6d168be06b00 100644 --- a/reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/3.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -100,9 +100,9 @@ For more information about how PowerShell uses wildcards, see [about_Wildcards]( > [!NOTE] > To limit the search to a relative path, you must prefix the script name with -> the `.\`. This limits the search for commands to files in -> that folder. Without this prefix, other PowerShell syntax may conflict and -> there are few guarantees that the file will be found. +> the `.\` path. This limits the search for commands to files in that relative +> path. Without this prefix, other PowerShell syntax may conflict and there are +> few guarantees that the file will be found. If you do not specify a path, PowerShell uses the following precedence order when it runs commands: diff --git a/reference/4.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/4.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index 6f128910737c..a964775ebb4b 100644 --- a/reference/4.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/4.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -100,9 +100,9 @@ For more information about how PowerShell uses wildcards, see [about_Wildcards]( > [!NOTE] > To limit the search to a relative path, you must prefix the script name with -> the relative folder name. This limits the search for commands to files in -> that folder. Without this prefix, other PowerShell syntax may conflict and -> there are few guarantees that the file will be found. +> the `.\` path. This limits the search for commands to files in that relative +> path. Without this prefix, other PowerShell syntax may conflict and there are +> few guarantees that the file will be found. If you do not specify a path, PowerShell uses the following precedence order when it runs commands: diff --git a/reference/5.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/5.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index 6f128910737c..a964775ebb4b 100644 --- a/reference/5.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/5.0/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -100,9 +100,9 @@ For more information about how PowerShell uses wildcards, see [about_Wildcards]( > [!NOTE] > To limit the search to a relative path, you must prefix the script name with -> the relative folder name. This limits the search for commands to files in -> that folder. Without this prefix, other PowerShell syntax may conflict and -> there are few guarantees that the file will be found. +> the `.\` path. This limits the search for commands to files in that relative +> path. Without this prefix, other PowerShell syntax may conflict and there are +> few guarantees that the file will be found. If you do not specify a path, PowerShell uses the following precedence order when it runs commands: diff --git a/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index 6f128910737c..a964775ebb4b 100644 --- a/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/5.1/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -100,9 +100,9 @@ For more information about how PowerShell uses wildcards, see [about_Wildcards]( > [!NOTE] > To limit the search to a relative path, you must prefix the script name with -> the relative folder name. This limits the search for commands to files in -> that folder. Without this prefix, other PowerShell syntax may conflict and -> there are few guarantees that the file will be found. +> the `.\` path. This limits the search for commands to files in that relative +> path. Without this prefix, other PowerShell syntax may conflict and there are +> few guarantees that the file will be found. If you do not specify a path, PowerShell uses the following precedence order when it runs commands: diff --git a/reference/6/Microsoft.PowerShell.Core/About/about_Command_Precedence.md b/reference/6/Microsoft.PowerShell.Core/About/about_Command_Precedence.md index 6f128910737c..a964775ebb4b 100644 --- a/reference/6/Microsoft.PowerShell.Core/About/about_Command_Precedence.md +++ b/reference/6/Microsoft.PowerShell.Core/About/about_Command_Precedence.md @@ -100,9 +100,9 @@ For more information about how PowerShell uses wildcards, see [about_Wildcards]( > [!NOTE] > To limit the search to a relative path, you must prefix the script name with -> the relative folder name. This limits the search for commands to files in -> that folder. Without this prefix, other PowerShell syntax may conflict and -> there are few guarantees that the file will be found. +> the `.\` path. This limits the search for commands to files in that relative +> path. Without this prefix, other PowerShell syntax may conflict and there are +> few guarantees that the file will be found. If you do not specify a path, PowerShell uses the following precedence order when it runs commands: