Join-Path [-Path] <String[]> [-ChildPath] <String> [[-AdditionalChildPath] <String[]>] [-Resolve] [-Credential <PSCredential>] [<CommonParameters>]说明Join-Path cmdlet 将路径和子路径合并为单个路径。提供程序提供路径分隔符。示例示例1:
Join-Path'C:\Program Files'WindowsPowerShell 会把C:\Program Files和子文件/文件夹WindowsPowerShell连接在一起生成C:\Program Files\WindowsPowerShell 但根据Join-Path的说明,其并不支持将多级子文件夹连接在一起生成一个新路径。 比如,我想将C:\Program Files以及WindowsPowerShell和Modules两级子目录连接生成C:...
PS C:\>Get-PSDrive-PSProvider filesystem |ForEach{$_.root} |Join-Path-ChildPath"Subdir" This command combines the roots of each Windows PowerShell file system drive in the console with the Subdir child path. The command uses the Get-PSDrive cmdlet to get the Windows PowerShell drives suppo...
Join-Path -Path C:, D:, E:, F: -ChildPath New C:\New D:\New E:\New F:\NewTento příkaz slouží Join-Path ke kombinování více kořenových cest s podřízenou cestou.Poznámka Jednotky určené Path musí existovat nebo spojení této položky selže.Příkl...
Join-Path Move-Item Move-ItemProperty New-Item New-ItemProperty New-PSDrive New-Service Pop-Location Push-Location Remove-Item Remove-ItemProperty Remove-PSDrive Remove-Service Rename-Computer Rename-Item Rename-ItemProperty Resolve-Path Restart-Computer ...
A command that adds the parent and child parts of a path together with the appropriate path separator.
# Function to unpin an application from the taskbarfunctionUnpin-AppFromTaskbar{param([string]$AppName)$shell=New-Object-ComObject shell.application $folder=$shell.Namespace((Join-Path $env:APPDATA"Microsoft\Internet Explorer\Quick Launch\User Pinned\TaskBar"))foreach($itemin$folder.Items()){i...
Convert -ChildPath parameter to string[] for Join-Path cmdlet (#24677) (Thanks @ArmaanMcleod!)PowerShell 7.6-preview.4 includes the following updated modules:Microsoft.PowerShell.ThreadJob v2.2.0 ThreadJob v2.1.0 The ThreadJob module was renamed to Microsoft.PowerShell.ThreadJob. There is no...
Test-Path [-Path] <String[]> [-Filter <String>] [-Include <String[]>] [-Exclude <String[]>] [-PathType <TestPathType>] [-IsValid] [-Credential <PSCredential>] [-OlderThan <DateTime>] [-NewerThan <DateTime>] [<CommonParameters>]Power...
它们旨在用于要以特定格式显示路径的所有或部分的程序和脚本。 使用它们,就像使用 Dirname、Normpath、Realpath、Join或其他路径处理器一样。 Test-Path 旨在处理任何提供程序公开的数据。 若要列出会话中可用的提供程序,请键入 Get-PSProvider。 有关详细信息,请参阅 about_Providers。