powershell - 如何获取目录的父文件夹

标签 powershell

我目前正在Powershell中编写脚本(第一次),该脚本在构建时会被tfs调用。我所拥有的是提供给我的环境变量,例如:

$Env:TF_BUILD_BINARIESDIRECTORY

我需要的是让父目录进入该目录。我该怎么做呢?

更新:确实,我只是在尝试将复制项复制到$ Env的父项的父项中:TF_BUILD_BINARIESDIRECTORY

最佳答案

你想得太辛苦了

cp $yourFile $Env:TF_BUILD_BINARIESDIRECTORY\..\..

脚本编写愉快!

关于powershell - 如何获取目录的父文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25127086/

相关文章:

excel - 如何在powershell中读取Excel文件?

sql - 使用条件从 powershell 脚本运行脚本

powershell - 将 MKS 替换为 Powershell

windows - 在 Windows 上突出显示或下划线输出到标准输出

powershell - 在 Powershell 中将对象添加到容器

powershell - 更新-AzureRmVmss : Required parameter 'adminPassword' is missing (null)

windows - 如何在PowerShell中查询Windows 10设备的经纬度?

powershell - 如何隐藏powershell脚本模块代码

powershell - 全局变量用例

powershell - 如何从自定义 shell 使用 GitHub for Windows 附带的 posh-git?