powershell - Powershell 中的目录书签?

标签 powershell

我最喜欢的 Bash 技巧之一涉及创建用于标记和返回目录的别名,如下所述:http://www.huyng.com/archives/quick-bash-tip-directory-bookmarks/492/ .

在 Bash 中,它看起来像这样:

alias m1='alias g1="cd `pwd`"'

是否可以在powershell中创建类似的函数?

最佳答案

这个项目运行得很好:http://www.powershellmagazine.com/2016/05/06/powershell-location-bookmark-for-easy-and-faster-navigation/

安装:

Install-Module -Name PSBookmark

用途:

#This will save $PWD as scripts
save scripts 

#This will save C:\Documents as docs
save docs C:\Documents

#You don't have to type the alias name.
#Instead, you can just tab complete. This function uses dynamic parameters.
goto docs

关于powershell - Powershell 中的目录书签?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7984974/

相关文章:

某些 JSON 文件出现 PowerShell FilterScript 错误

powershell - Azure Service Fabric - 提高本地性能

powershell - 如何在哈希表中查找多值名称?

powershell - 尝试在PowerShell中查找具有特定字符串的文件

powershell - 如何处理带有特殊字符的文件路径?

powershell - 搜索邮箱SearchQuery不起作用

javascript - 通过powershell登录内部网站

powershell - Azure Powershell 抛出 "Unknown User Type"

powershell - 如何在 Ubuntu 18.04 上将 Powershell Core 更新到最新版本

powershell - 如何获取我执行的PowerShell脚本的目录?