Updates from: 03/17/2021 04:11:39
Service Microsoft Docs article Related commit history on GitHub Change details
Microsoft.PowerShell.Core About Automatic Variables (5.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/5.1/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md
--- description: Describes variables that store state information for PowerShell. These variables are created and maintained by PowerShell. Locale: en-US Previously updated : 12/14/2020 Last updated : 03/15/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_automatic_variables?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about_Automatic_Variables
following items:
### $PWD
-Contains a path object that represents the full path of the current directory.
+Contains a path object that represents the full path of the current directory
+location for the current PowerShell runspace.
+
+> [!NOTE]
+> PowerShell supports multiple runspaces per process. Each runspace has its own
+> _current directory_. This is not the same as the current directory of the
+> process: `[System.Environment]::CurrentDirectory`.
### $Sender
Microsoft.PowerShell.Core About Locations (5.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/5.1/Microsoft.PowerShell.Core/About/about_Locations.md
---
-description: Describes how to access items from the working location in PowerShell.
-keywords: powershell,cmdlet
+description: Describes how to access items from the working location in PowerShell.
Locale: en-US Previously updated : 06/09/2017 Last updated : 03/15/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_locations?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about_Locations
Title: about_Locations
# about_Locations
-## SHORT DESCRIPTION
-
+## Short description
Describes how to access items from the working location in PowerShell.
-## LONG DESCRIPTION
+## Long description
The current working location is the default location to which commands point. In other words, this is the location that PowerShell uses if you do not supply
-an explicit path to the item or location that is affected by the command. In
-most cases, the current working location is a drive accessed through the
+an explicit path to the item or location that is affected by the command.
+
+> [!NOTE]
+> PowerShell supports multiple runspaces per process. Each runspace has its own
+> _current directory_. This is not the same as the current directory of the
+> process: `[System.Environment]::CurrentDirectory`.
+
+In most cases, the current working location is a drive accessed through the
PowerShell FileSystem provider and, in some cases, a directory on that drive. For example, you might set your current working location to the following location:
is explicitly provided.
PowerShell maintains the current working location for each drive even when the drive is not the current drive. This allows you to access items from the current working location by referring only to the drive of another location.
-For example, suppose that your current working location is C:\\Windows. Now,
+For example, suppose that your current working location is `C:\Windows`. Now,
suppose you use the following command to change your current working location to the HKLM: drive:
Set-Location HKLM:
``` Although your current location is now the registry drive, you can still access
-items in the C:\\Windows directory simply by using the C: drive, as shown in
+items in the `C:\Windows` directory simply by using the C: drive, as shown in
the following example: ```powershell
subdirectory in the current working location:
Get-ChildItem .\system ```
-If the current working location is C:\\Windows, this command returns a list of
-all the items in C:\\Windows\\System. However, if you use two periods, the
+If the current working location is `C:\Windows`, this command returns a list of
+all the items in `C:\Windows\System`. However, if you use two periods, the
parent directory of the current working directory is used, as shown in the following example:
Get-ChildItem ..\"program files"
``` In this case, PowerShell treats the two periods as the C: drive, so the
-command retrieves all the items in the C:\\Program Files directory.
+command retrieves all the items in the `C:\Program Files` directory.
A path beginning with a slash identifies a path from the root of the current
-drive. For example, if your current working location is C:\\Program
-Files\\PowerShell, the root of your drive is C. Therefore, the following
-command lists all items in the C:\\Windows directory:
+drive. For example, if your current working location is
+`C:\Program Files\PowerShell`, the root of your drive is C. Therefore, the
+following command lists all items in the `C:\Windows` directory:
```powershell Get-ChildItem \windows
Get-ChildItem \windows
If you do not specify a path beginning with a drive name, slash, or period when supplying the name of a container or item, the container or item is assumed to be located in the current working location. For example, if your
-current working location is C:\\Windows, the following command returns all the
-items in the C:\\Windows\\System directory:
+current working location is `C:\Windows`, the following command returns all the
+items in the `C:\Windows\System` directory:
```powershell Get-ChildItem system
If you specify a file name rather than a directory name, PowerShell returns
details about that file (assuming that file is located in the current working location).
-## SEE ALSO
+## See also
[Set-Location](xref:Microsoft.PowerShell.Management.Set-Location)
Microsoft.PowerShell.Core About Methods (5.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/5.1/Microsoft.PowerShell.Core/About/about_Methods.md
--- description: Describes how to use methods to perform actions on objects in PowerShell.
-keywords: powershell,cmdlet
Locale: en-US Previously updated : 04/08/2020 Last updated : 03/15/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_methods?view=powershell-5.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about_Methods
results in an object (like a string in quotes).
Starting in PowerShell 4.0, method invocation by using dynamic method names is supported.
-### Learning about methods
+## Learning about methods
To find definitions of the methods of an object, go to help topic for the object type and look for its methods page. For example, the following page
file to the `C:\Bin` directory, and to overwrite existing files.
(Get-ChildItem c:\final.txt).CopyTo("c:\bin\final.txt", $true) ```
-### Methods of Scalar objects and Collections
+## Methods of Scalar objects and Collections
The methods of one ("scalar") object of a particular type are often different from the methods of a collection of objects of the same type.
$p | ForEach-Object {$_.Kill()}
### ForEach and Where methods
-Beginning in PowerShell 4.0, collection filtering by using a method syntax is
+Beginning in PowerShell 4.0, collection filtering using a method syntax is
supported. This allows use of two new methods when dealing with collections `ForEach` and `Where`. You can read more about these methods in [about_arrays](about_arrays.md)
-### Calling a specific method when multiple overloads exist
+## Calling a specific method when multiple overloads exist
Consider the following scenario when calling .NET methods. If a method takes an object but has an overload via an interface taking a more specific type,
specific overload of the **Bar** method.
int: 1 ```
+## Using .NET methods that take filesystem paths
+
+PowerShell supports multiple runspaces per process. Each runspace has its own
+_current directory_. This is not the same as the working directory of the
+current process: `[System.Environment]::CurrentDirectory`.
+
+.NET methods use the process working directory. PowerShell cmdlets use the
+Runspace location. Also, .NET methods only work with native filesystem paths,
+not PowerShell Path objects. To use PowerShell paths with .NET methods, you
+must resolve the path to a filesystem-native path before passing it to the .NET
+method.
+ ## See Also [about_Objects](about_Objects.md)
Microsoft.PowerShell.Core About Automatic Variables (7.0) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.0/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md
--- description: Describes variables that store state information for PowerShell. These variables are created and maintained by PowerShell. Locale: en-US Previously updated : 12/14/2020 Last updated : 03/15/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_automatic_variables?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about_Automatic_Variables
following items:
### $PWD
-Contains a path object that represents the full path of the current directory.
+Contains a path object that represents the full path of the current directory
+location for the current PowerShell runspace.
+
+> [!NOTE]
+> PowerShell supports multiple runspaces per process. Each runspace has its own
+> _current directory_. This is not the same as the current directory of the
+> process: `[System.Environment]::CurrentDirectory`.
### $Sender
Microsoft.PowerShell.Core About Locations (7.0) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.0/Microsoft.PowerShell.Core/About/about_Locations.md
---
-description: Describes how to access items from the working location in PowerShell.
-keywords: powershell,cmdlet
+description: Describes how to access items from the working location in PowerShell.
Locale: en-US Previously updated : 06/09/2017 Last updated : 03/15/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_locations?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about_Locations --- # about_Locations
-## SHORT DESCRIPTION
+## Short description
Describes how to access items from the working location in PowerShell.
-## LONG DESCRIPTION
+## Long description
The current working location is the default location to which commands point. In other words, this is the location that PowerShell uses if you do not supply
-an explicit path to the item or location that is affected by the command. In
-most cases, the current working location is a drive accessed through the
+an explicit path to the item or location that is affected by the command.
+
+> [!NOTE]
+> PowerShell supports multiple runspaces per process. Each runspace has its own
+> _current directory_. This is not the same as the current directory of the
+> process: `[System.Environment]::CurrentDirectory`.
+
+In most cases, the current working location is a drive accessed through the
PowerShell FileSystem provider and, in some cases, a directory on that drive. For example, you might set your current working location to the following location:
is explicitly provided.
PowerShell maintains the current working location for each drive even when the drive is not the current drive. This allows you to access items from the current working location by referring only to the drive of another location.
-For example, suppose that your current working location is C:\\Windows. Now,
+For example, suppose that your current working location is `C:\Windows`. Now,
suppose you use the following command to change your current working location to the HKLM: drive:
Set-Location HKLM:
``` Although your current location is now the registry drive, you can still access
-items in the C:\\Windows directory simply by using the C: drive, as shown in
+items in the `C:\Windows` directory simply by using the C: drive, as shown in
the following example: ```powershell
subdirectory in the current working location:
Get-ChildItem .\system ```
-If the current working location is C:\\Windows, this command returns a list of
-all the items in C:\\Windows\\System. However, if you use two periods, the
+If the current working location is `C:\Windows`, this command returns a list of
+all the items in `C:\Windows\System`. However, if you use two periods, the
parent directory of the current working directory is used, as shown in the following example:
Get-ChildItem ..\"program files"
``` In this case, PowerShell treats the two periods as the C: drive, so the
-command retrieves all the items in the C:\\Program Files directory.
+command retrieves all the items in the `C:\Program Files` directory.
A path beginning with a slash identifies a path from the root of the current
-drive. For example, if your current working location is C:\\Program
-Files\\PowerShell, the root of your drive is C. Therefore, the following
-command lists all items in the C:\\Windows directory:
+drive. For example, if your current working location is
+`C:\Program Files\PowerShell`, the root of your drive is C. Therefore, the
+following command lists all items in the `C:\Windows` directory:
```powershell Get-ChildItem \windows
Get-ChildItem \windows
If you do not specify a path beginning with a drive name, slash, or period when supplying the name of a container or item, the container or item is assumed to be located in the current working location. For example, if your
-current working location is C:\\Windows, the following command returns all the
-items in the C:\\Windows\\System directory:
+current working location is `C:\Windows`, the following command returns all the
+items in the `C:\Windows\System` directory:
```powershell Get-ChildItem system
If you specify a file name rather than a directory name, PowerShell returns
details about that file (assuming that file is located in the current working location).
-## SEE ALSO
+## See also
[Set-Location](xref:Microsoft.PowerShell.Management.Set-Location)
Microsoft.PowerShell.Core About Methods (7.0) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.0/Microsoft.PowerShell.Core/About/about_Methods.md
--- description: Describes how to use methods to perform actions on objects in PowerShell.
-keywords: powershell,cmdlet
Locale: en-US Previously updated : 04/08/2020 Last updated : 03/15/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_methods?view=powershell-7&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about_Methods
results in an object (like a string in quotes).
Starting in PowerShell 4.0, method invocation by using dynamic method names is supported.
-### Learning about methods
+## Learning about methods
To find definitions of the methods of an object, go to help topic for the object type and look for its methods page. For example, the following page
file to the `C:\Bin` directory, and to overwrite existing files.
(Get-ChildItem c:\final.txt).CopyTo("c:\bin\final.txt", $true) ```
-### Methods of Scalar objects and Collections
+## Methods of Scalar objects and Collections
The methods of one ("scalar") object of a particular type are often different from the methods of a collection of objects of the same type.
$p | ForEach-Object {$_.Kill()}
### ForEach and Where methods
-Beginning in PowerShell 4.0, collection filtering by using a method syntax is
+Beginning in PowerShell 4.0, collection filtering using a method syntax is
supported. This allows use of two new methods when dealing with collections `ForEach` and `Where`. You can read more about these methods in [about_arrays](about_arrays.md)
-### Calling a specific method when multiple overloads exist
+## Calling a specific method when multiple overloads exist
Consider the following scenario when calling .NET methods. If a method takes an object but has an overload via an interface taking a more specific type,
specific overload of the **Bar** method.
int: 1 ```
+## Using .NET methods that take filesystem paths
+
+PowerShell supports multiple runspaces per process. Each runspace has its own
+_current directory_. This is not the same as the working directory of the
+current process: `[System.Environment]::CurrentDirectory`.
+
+.NET methods use the process working directory. PowerShell cmdlets use the
+Runspace location. Also, .NET methods only work with native filesystem paths,
+not PowerShell Path objects. To use PowerShell paths with .NET methods, you
+must resolve the path to a filesystem-native path before passing it to the .NET
+method.
+ ## See Also [about_Objects](about_Objects.md)
Microsoft.PowerShell.Core About Automatic Variables (7.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.1/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md
--- description: Describes variables that store state information for PowerShell. These variables are created and maintained by PowerShell. Locale: en-US Previously updated : 12/14/2020 Last updated : 03/15/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_automatic_variables?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about_Automatic_Variables
following items:
### $PWD
-Contains a path object that represents the full path of the current directory.
+Contains a path object that represents the full path of the current directory
+location for the current PowerShell runspace.
+
+> [!NOTE]
+> PowerShell supports multiple runspaces per process. Each runspace has its own
+> _current directory_. This is not the same as the current directory of the
+> process: `[System.Environment]::CurrentDirectory`.
### $Sender
Microsoft.PowerShell.Core About Locations (7.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.1/Microsoft.PowerShell.Core/About/about_Locations.md
---
-description: Describes how to access items from the working location in PowerShell.
-keywords: powershell,cmdlet
+description: Describes how to access items from the working location in PowerShell.
Locale: en-US Previously updated : 06/09/2017 Last updated : 03/15/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_locations?view=powershell-7.1&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about_Locations --- # about_Locations
-## SHORT DESCRIPTION
+## Short description
Describes how to access items from the working location in PowerShell.
-## LONG DESCRIPTION
+## Long description
The current working location is the default location to which commands point. In other words, this is the location that PowerShell uses if you do not supply
-an explicit path to the item or location that is affected by the command. In
-most cases, the current working location is a drive accessed through the
+an explicit path to the item or location that is affected by the command.
+
+> [!NOTE]
+> PowerShell supports multiple runspaces per process. Each runspace has its own
+> _current directory_. This is not the same as the current directory of the
+> process: `[System.Environment]::CurrentDirectory`.
+
+In most cases, the current working location is a drive accessed through the
PowerShell FileSystem provider and, in some cases, a directory on that drive. For example, you might set your current working location to the following location:
is explicitly provided.
PowerShell maintains the current working location for each drive even when the drive is not the current drive. This allows you to access items from the current working location by referring only to the drive of another location.
-For example, suppose that your current working location is C:\\Windows. Now,
+For example, suppose that your current working location is `C:\Windows`. Now,
suppose you use the following command to change your current working location to the HKLM: drive:
Set-Location HKLM:
``` Although your current location is now the registry drive, you can still access
-items in the C:\\Windows directory simply by using the C: drive, as shown in
+items in the `C:\Windows` directory simply by using the C: drive, as shown in
the following example: ```powershell
subdirectory in the current working location:
Get-ChildItem .\system ```
-If the current working location is C:\\Windows, this command returns a list of
-all the items in C:\\Windows\\System. However, if you use two periods, the
+If the current working location is `C:\Windows`, this command returns a list of
+all the items in `C:\Windows\System`. However, if you use two periods, the
parent directory of the current working directory is used, as shown in the following example:
Get-ChildItem ..\"program files"
``` In this case, PowerShell treats the two periods as the C: drive, so the
-command retrieves all the items in the C:\\Program Files directory.
+command retrieves all the items in the `C:\Program Files` directory.
A path beginning with a slash identifies a path from the root of the current
-drive. For example, if your current working location is C:\\Program
-Files\\PowerShell, the root of your drive is C. Therefore, the following
-command lists all items in the C:\\Windows directory:
+drive. For example, if your current working location is
+`C:\Program Files\PowerShell`, the root of your drive is C. Therefore, the
+following command lists all items in the `C:\Windows` directory:
```powershell Get-ChildItem \windows
Get-ChildItem \windows
If you do not specify a path beginning with a drive name, slash, or period when supplying the name of a container or item, the container or item is assumed to be located in the current working location. For example, if your
-current working location is C:\\Windows, the following command returns all the
-items in the C:\\Windows\\System directory:
+current working location is `C:\Windows`, the following command returns all the
+items in the `C:\Windows\System` directory:
```powershell Get-ChildItem system
If you specify a file name rather than a directory name, PowerShell returns
details about that file (assuming that file is located in the current working location).
-## SEE ALSO
+## See also
[Set-Location](xref:Microsoft.PowerShell.Management.Set-Location) [about_Providers](about_Providers.md) [about_Path_Syntax](about_Path_Syntax.md)-
Microsoft.PowerShell.Core About Methods (7.1) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.1/Microsoft.PowerShell.Core/About/about_Methods.md
--- description: Describes how to use methods to perform actions on objects in PowerShell.
-keywords: powershell,cmdlet
Locale: en-US Last updated 04/08/2020 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_methods?view=powershell-7.1&WT.mc_id=ps-gethelp
results in an object (like a string in quotes).
Starting in PowerShell 4.0, method invocation by using dynamic method names is supported.
-### Learning about methods
+## Learning about methods
To find definitions of the methods of an object, go to help topic for the object type and look for its methods page. For example, the following page
file to the `C:\Bin` directory, and to overwrite existing files.
(Get-ChildItem c:\final.txt).CopyTo("c:\bin\final.txt", $true) ```
-### Methods of Scalar objects and Collections
+## Methods of Scalar objects and Collections
The methods of one ("scalar") object of a particular type are often different from the methods of a collection of objects of the same type.
$p | ForEach-Object {$_.Kill()}
### ForEach and Where methods
-Beginning in PowerShell 4.0, collection filtering by using a method syntax is
+Beginning in PowerShell 4.0, collection filtering using a method syntax is
supported. This allows use of two new methods when dealing with collections `ForEach` and `Where`. You can read more about these methods in [about_arrays](about_arrays.md)
-### Calling a specific method when multiple overloads exist
+## Calling a specific method when multiple overloads exist
Consider the following scenario when calling .NET methods. If a method takes an object but has an overload via an interface taking a more specific type,
specific overload of the **Bar** method.
int: 1 ```
+## Using .NET methods that take filesystem paths
+
+PowerShell supports multiple runspaces per process. Each runspace has its own
+_current directory_. This is not the same as the working directory of the
+current process: `[System.Environment]::CurrentDirectory`.
+
+.NET methods use the process working directory. PowerShell cmdlets use the
+Runspace location. Also, .NET methods only work with native filesystem paths,
+not PowerShell Path objects. To use PowerShell paths with .NET methods, you
+must resolve the path to a filesystem-native path before passing it to the .NET
+method.
+ ## See Also [about_Objects](about_Objects.md)
int: 1
[about_Properties](about_Properties.md) [Get-Member](xref:Microsoft.PowerShell.Utility.Get-Member)-
Microsoft.PowerShell.Core About Automatic Variables (7.2) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.2/Microsoft.PowerShell.Core/About/about_Automatic_Variables.md
--- description: Describes variables that store state information for PowerShell. These variables are created and maintained by PowerShell. Locale: en-US Previously updated : 12/14/2020 Last updated : 03/15/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_automatic_variables?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about_Automatic_Variables
following items:
### $PWD
-Contains a path object that represents the full path of the current directory.
+Contains a path object that represents the full path of the current directory
+location for the current PowerShell runspace.
+
+> [!NOTE]
+> PowerShell supports multiple runspaces per process. Each runspace has its own
+> _current directory_. This is not the same as the current directory of the
+> process: `[System.Environment]::CurrentDirectory`.
### $Sender
Microsoft.PowerShell.Core About Locations (7.2) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.2/Microsoft.PowerShell.Core/About/about_Locations.md
--- description: Describes how to access items from the working location in PowerShell. Locale: en-US Previously updated : 06/09/2017 Last updated : 03/15/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_locations?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about_Locations --- # about_Locations
-## SHORT DESCRIPTION
+## Short description
Describes how to access items from the working location in PowerShell.
-## LONG DESCRIPTION
+## Long description
The current working location is the default location to which commands point. In other words, this is the location that PowerShell uses if you do not supply
-an explicit path to the item or location that is affected by the command. In
-most cases, the current working location is a drive accessed through the
+an explicit path to the item or location that is affected by the command.
+
+> [!NOTE]
+> PowerShell supports multiple runspaces per process. Each runspace has its own
+> _current directory_. This is not the same as the current directory of the
+> process: `[System.Environment]::CurrentDirectory`.
+
+In most cases, the current working location is a drive accessed through the
PowerShell FileSystem provider and, in some cases, a directory on that drive. For example, you might set your current working location to the following location:
is explicitly provided.
PowerShell maintains the current working location for each drive even when the drive is not the current drive. This allows you to access items from the current working location by referring only to the drive of another location.
-For example, suppose that your current working location is C:\\Windows. Now,
+For example, suppose that your current working location is `C:\Windows`. Now,
suppose you use the following command to change your current working location to the HKLM: drive:
Set-Location HKLM:
``` Although your current location is now the registry drive, you can still access
-items in the C:\\Windows directory simply by using the C: drive, as shown in
+items in the `C:\Windows` directory simply by using the C: drive, as shown in
the following example: ```powershell
subdirectory in the current working location:
Get-ChildItem .\system ```
-If the current working location is C:\\Windows, this command returns a list of
-all the items in C:\\Windows\\System. However, if you use two periods, the
+If the current working location is `C:\Windows`, this command returns a list of
+all the items in `C:\Windows\System`. However, if you use two periods, the
parent directory of the current working directory is used, as shown in the following example:
Get-ChildItem ..\"program files"
``` In this case, PowerShell treats the two periods as the C: drive, so the
-command retrieves all the items in the C:\\Program Files directory.
+command retrieves all the items in the `C:\Program Files` directory.
A path beginning with a slash identifies a path from the root of the current
-drive. For example, if your current working location is C:\\Program
-Files\\PowerShell, the root of your drive is C. Therefore, the following
-command lists all items in the C:\\Windows directory:
+drive. For example, if your current working location is
+`C:\Program Files\PowerShell`, the root of your drive is C. Therefore, the
+following command lists all items in the `C:\Windows` directory:
```powershell Get-ChildItem \windows
Get-ChildItem \windows
If you do not specify a path beginning with a drive name, slash, or period when supplying the name of a container or item, the container or item is assumed to be located in the current working location. For example, if your
-current working location is C:\\Windows, the following command returns all the
-items in the C:\\Windows\\System directory:
+current working location is `C:\Windows`, the following command returns all the
+items in the `C:\Windows\System` directory:
```powershell Get-ChildItem system
If you specify a file name rather than a directory name, PowerShell returns
details about that file (assuming that file is located in the current working location).
-## SEE ALSO
+## See also
[Set-Location](xref:Microsoft.PowerShell.Management.Set-Location) [about_Providers](about_Providers.md) [about_Path_Syntax](about_Path_Syntax.md)-
Microsoft.PowerShell.Core About Methods (7.2) https://github.com/MicrosoftDocs/PowerShell-Docs/commits/staging/reference/7.2/Microsoft.PowerShell.Core/About/about_Methods.md
--- description: Describes how to use methods to perform actions on objects in PowerShell. Locale: en-US Previously updated : 04/08/2020 Last updated : 03/15/2021 online version: https://docs.microsoft.com/powershell/module/microsoft.powershell.core/about/about_methods?view=powershell-7.2&WT.mc_id=ps-gethelp schema: 2.0.0 Title: about_Methods
results in an object (like a string in quotes).
Starting in PowerShell 4.0, method invocation by using dynamic method names is supported.
-### Learning about methods
+## Learning about methods
To find definitions of the methods of an object, go to help topic for the object type and look for its methods page. For example, the following page
file to the `C:\Bin` directory, and to overwrite existing files.
(Get-ChildItem c:\final.txt).CopyTo("c:\bin\final.txt", $true) ```
-### Methods of Scalar objects and Collections
+## Methods of Scalar objects and Collections
The methods of one ("scalar") object of a particular type are often different from the methods of a collection of objects of the same type.
$p | ForEach-Object {$_.Kill()}
### ForEach and Where methods
-Beginning in PowerShell 4.0, collection filtering by using a method syntax is
+Beginning in PowerShell 4.0, collection filtering using a method syntax is
supported. This allows use of two new methods when dealing with collections `ForEach` and `Where`. You can read more about these methods in [about_arrays](about_arrays.md)
-### Calling a specific method when multiple overloads exist
+## Calling a specific method when multiple overloads exist
Consider the following scenario when calling .NET methods. If a method takes an object but has an overload via an interface taking a more specific type,
specific overload of the **Bar** method.
int: 1 ```
+## Using .NET methods that take filesystem paths
+
+PowerShell supports multiple runspaces per process. Each runspace has its own
+_current directory_. This is not the same as the working directory of the
+current process: `[System.Environment]::CurrentDirectory`.
+
+.NET methods use the process working directory. PowerShell cmdlets use the
+Runspace location. Also, .NET methods only work with native filesystem paths,
+not PowerShell Path objects. To use PowerShell paths with .NET methods, you
+must resolve the path to a filesystem-native path before passing it to the .NET
+method.
+ ## See Also [about_Objects](about_Objects.md)
int: 1
[about_Properties](about_Properties.md) [Get-Member](xref:Microsoft.PowerShell.Utility.Get-Member)-