Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/powershell/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
“之间的区别是什么?”&引用;和[System.ENVIRONMENT]::powershell中的CurrentDirectory?_Powershell_Filesystems - Fatal编程技术网

“之间的区别是什么?”&引用;和[System.ENVIRONMENT]::powershell中的CurrentDirectory?

“之间的区别是什么?”&引用;和[System.ENVIRONMENT]::powershell中的CurrentDirectory?,powershell,filesystems,Powershell,Filesystems,[System.Environment]:CurrentDirectory返回PowerShell进程的工作目录。要获取控制台会话的工作目录,请使用get Locationcmdlet(或pwd,$pwd) 请注意,此“工作目录”也可以是注册表中的一个位置,也可以是许多其他位置提供程序中的任何一个 PM> $path = "." PM> Get-ChildItem $path -filter '.nuget' Directory: C:\Users\david\Docum

[System.Environment]:CurrentDirectory
返回PowerShell进程的工作目录。要获取控制台会话的工作目录,请使用
get Location
cmdlet(或pwd,$pwd)

请注意,此“工作目录”也可以是注册表中的一个位置,也可以是许多其他位置提供程序中的任何一个

PM> $path = "."
PM> Get-ChildItem $path -filter '.nuget'


    Directory: C:\Users\david\Documents\Visual Studio 2010\Projects\...


Mode                LastWriteTime     Length Name                                                                                                                                                                
----                -------------     ------ ----                                                                                                                                                                
d----        25.05.2012     16:20            .nuget                                                                                                                                                              


PM> $cwd = [System.ENVIRONMENT]::CurrentDirectory
PM> $cwd
C:\Windows\system32
PM> Get-ChildItem $cwd -filter '.nuget'
PM> Get-ChildItem $cwd -filter 'adsnt.dll'


    Directory: C:\Windows\system32


Mode                LastWriteTime     Length Name                                                                                                                                                                
----                -------------     ------ ----                                                                                                                                                                
-a---        14.07.2009     03:14     260608 adsnt.dll                                                                                                                                                           


PM> [System.IO.PATH]::GetFullPath(".")
C:\Windows\system32
PM>