CmdletGet-Location類似於BASH 殼層中的 pwd命令。 CmdletSet-Location類似於Cmd.exe 中的 cd命令。 設定您目前的位置 (Set-Location) 命令Get-Location會與 命令搭配Set-Location使用。Set-Location命令可讓您指定目前的目錄位置。 PowerShell複製 Set-Location-PathC:\
Get-Location [-Stack] [-StackName <String[]>] [<CommonParameters>]说明Get-Location cmdlet 获取表示当前目录的对象,这与打印工作目录 (pwd) 命令非常类似。在PowerShell 驱动器之间移动时,PowerShell 会在每个驱动器中保留位置。 可以使用此 cmdlet 查找每个驱动器中的位置。可以使用此 cmdlet 在运行时获取当...
HKCU Registry HKEY_CURRENT_USER HKLM Registry HKEY_LOCAL_MACHINE Variable Variable WSMan WSMan 如果要求指定驱动器来源,则使用PSProvider参数。其中FileSystem为文件系统,Registry为注册表。 示例:文件系统 Get-PSDrive-PSProviderFileSystem 输出 Name Used (GB) Free (GB) Provider Root CurrentLocation --- -...
在PowerShell 中,可以使用 Get-Location 命令来确定当前工作位置,可以使用 Set-Location 命令设置当前工作位置。 例如,以下命令将当前工作位置设置为 Windows 驱动器的 C: 目录: PowerShell 复制 Set-Location C:\Windows 设置当前工作位置后,仍可通过在命令中包含驱动器名称(后跟冒号)来访问来自其他驱动器的项,...
#># Save current directory$SaveCurrentDir= (get-location).Path# Set RVTools path[string]$RVToolsPath="C:\Program Files (x86)\Dell\RVTools"# cd to RVTools directoryset-location$RVToolsPath# ---# Set parameters for vCenter 1 and start RVTools export# ---[string]$VCServer="192.168.2.2...
5、set-location,简称sl,相当于linux里的cd命令,这里cd也可以用,但是powershell跟cmd下不一样,powershell里的cd命令不需要加/d参数,加上就报错,cmd里的cd命令最好规规矩矩加上/d命令,切记 6、ls,列出目录下的文件,也可以用dir 7、get-item filename,get-item可以简写gi,获取文件属性,支持通配符 ...
属性,包括 Location 属性。Location 属性指示正在调试的脚本的路径。 $PsHome 包含Windows PowerShell 的安装目录的完整路径(通常为 %windir%System32WindowsPowerShellv1.0)。可以在 Windows PowerShell 文件 的路径中使用此变量。例如,下面的命令在概念性帮助主题中搜索”variable”一词: ...
Default value:<Current location> Required:True Accept pipeline input:True Accept wildcard characters:True -Repository Especifica el nombre descriptivo de un repositorio que se ha registrado mediante la ejecuciónRegister-PSRepositoryde . Type:String ...
Get-Item Get-ItemProperty Get-ItemPropertyValue Get-Location Get-Process Get-PSDrive Get-PSProvider Get-Service Get-TimeZone Invoke-Item Join-Path Move-Item Move-ItemProperty New-Item New-ItemProperty New-PSDrive New-Service Pop-Location Push-Location ...
PowerShell 可针对适用于 PowerShell 驱动器的命令使用名词 PSDrive。 若要获取 PowerShell 会话中的 PowerShell 驱动器列表,请使用Get-PSDrivecmdlet。 PowerShell Get-PSDrive Output Name Provider Root CurrentLocation --- --- --- --- A FileSystem A:\ Alias Alias C FileSystem C:\ ...And Settings...