We can also set different directory paths in PowerShell using the Set-Location cmdlet. Right now, we are in the C:\users\DELL directory. Use Set-Location Cmdlet 1 2 3 Set-Location C:\Intel\project Now, let’s run the Get-Location cmdlet to get the location of the current working ...
PowerShell Get-Location[-PSProvider <String[]>] [-PSDrive <String[]>] [<CommonParameters>] PowerShell Get-Location[-Stack] [-StackName <String[]>] [<CommonParameters>] Description TheGet-Locationcmdlet gets an object that represents the current directory, much like the print working directo...
PowerShell Get-Item. Directory: C:\ Mode LastWriteTime Length Name --- --- --- --- d---7/26/200610:01AMps-test Example 2: Get all the items in the current directory This example gets all the items in the current directory. The wildcard character (*) represents all the contents...
21. 使用 PowerShell Core 和远程管理 如果你在跨平台环境下使用 PowerShell Core,并希望管理远程 Windows 计算机的注册表,可以使用Invoke-Command和-Session参数来实现。 powershellCopy Code # 在远程计算机上操作注册表$session=New-PSSession-ComputerName"RemoteComputerName"Invoke-Command-Session$session-ScriptBlock...
PowerShell 複製 Get-Date [[-Date] <DateTime>] [-Year <Int32>] [-Month <Int32>] [-Day <Int32>] [-Hour <Int32>] [-Minute <Int32>] [-Second <Int32>] [-Millisecond <Int32>] [-DisplayHint <DisplayHintType>] [-Format <String>] [-AsUTC] [<CommonParameters>]...
PowerShell 复制 Get-Date [[-Date] <DateTime>] [-Year <Int32>] [-Month <Int32>] [-Day <Int32>] [-Hour <Int32>] [-Minute <Int32>] [-Second <Int32>] [-Millisecond <Int32>] [-DisplayHint <DisplayHintType>] [-Format <String>] [-AsUTC] [<CommonParameters>]...
PowerShell 複製 Get-PSDrive [-LiteralName] <String[]> [-Scope <String>] [-PSProvider <String[]>] [<CommonParameters>]DescriptionCmdlet 會 Get-PSDrive 取得目前會話中的磁碟驅動器。 您可以在工作階段中取得特定磁碟驅動器或所有磁碟驅動器。
Example 1: Get the current directory This example gets the current directory. The dot ('.') represents the item at the current location (not its contents). PowerShell คัดลอก Get-Item . Directory: C:\ Mode LastWriteTime Length Name --- --- --- --- d--- 7/26/200...
PowerShell 提供程序通过使用此 cmdlet,可以在不同类型的数据存储进行导航。示例示例1:获取当前目录此示例获取当前目录。 句点 ('.') 表示当前位置处的项(而非其内容)。PowerShell 复制 Get-Item . Directory: C:\ Mode LastWriteTime Length Name --- --- --- --- d--- 7/26/2006 10:01 AM ps-...
7] Get all subdirectory folder sizes using the PowerShell script Now, to make things more complicated, let’s assume that you must get the size of each sub-directory inside a folder. That can also be accomplished using PowerShell. Of course, To get all subdirectory folder sizes inclusive of...