简体   繁体   English

如何将已解析的路径与另一个目录连接起来

[英]How to concatenate resolved path with another directory

How to concatenate web config resources directory path with resolved main directory path. 如何将Web配置资源目录路径与已解析的主目录路径连接起来。 In Octopus resolve-path gets me correct path of directory but I wont be able to concatenate that path with another directory. 在Octopus中,resolve-path为我提供了正确的目录路径,但是我无法将该路径与另一个目录连接起来。 I am using following code, please guide. 我正在使用以下代码,请指导。

$webConfigResources = (resolve-path .)
$webConfigResources +=  "\ResourcesConfiguration.config"
$doc = (gc $webConfigResources) -as [xml]
$doc.SelectSingleNode('//resourcesConfigSection/resources/@baseDirectory').'#text' =            
$doc.Save($webConfigResources)

Resolve-Path returns a System.Management.Automation.PathInfo object (not a string). Resolve-Path返回System.Management.Automation.PathInfo对象(不是字符串)。 Use Join-Path : 使用Join-Path

$webConfigResources = Join-Path (Resolve-Path .) "\ResourcesConfiguration.config"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM