我需要将目录附加到unc路径,我需要以下内容
500 Internal Server Error
Sorry, something went wrong.
A team of highly trained monkeys has been dispatched to deal with this situation.
If you see them, send them this information as text (screenshots frighten them):
APkpgMUuvG-WqGSx1NgX6ikC3Hug0fm1givbK0ZiHsIQKJ5x6CZVmC8d
xU9F-VsLT1fQhpkvfx_kPwioGZT6fo-1VY8k_YKPEPXdozPTSv6rzxSS
-izWw5e0YfQRVKwRwWx4wW7D7fr_R9jbRVn188WqvnwAofxogSquhhkM
TUZh38X9019w4gbMCu3Ll_qrtEHsYtb3M8e7HIRsjwiSzrSgEzmlNCXB
UudgKPSvZeDIYIesYNnIcU1G_Ylnazir2vn9LqrdBJyQ2oIxrecKjyr1
WKdQvWVJyCreViU45xTWsUni5T-DpipWZo_SHFd_xrsjBWTt69B-DaGs
uM5TtT34mcqJ1taAyUt8oPsatZU6kVEjPu-_zeLTRqho0mq9_l5nzzgd
kUm2XudQuIS0N3tbFwzgbFFZ4h_JnX5hVAEnEs5qcc9rp-NBCw4fJMxp
POdLQASYRQuBT-T-cCbqptyvy2tYacSZxfKiVc-Hfgp1mTE0hRZSSOMj
NXEyj2RwLAyWGe4ZQVXpNJyG25mCciCO7KNMIBmMNGlp5X6sshZRvTZc
hQLgIn3yr3AsF53UP_3WXONu3vBWEbNzYdl6xVPivAr0rFhOhUHHZb2t
WCFN5NtXd-MKoKXHPb4scnXqBtkpb4sGteeDty3acvtkQS43y61lGdWe
BsvSdVAZ2NiKZzZxnkHBtaRirXgdCoNdVYDCe0W4TRiTpaRD3FvqNdJw
TawuXwz8YRB1-ruv5lq_f_zkB9r-ABqHW9MMR5LFHAV7y5S4mcSzJP2A
w3PlilAgsVe52yIhdR5qOxvtSzrnNEX7MgS9KRGhTukkSf8awkM4sbFq
xy4YmGw4maLpqVg6yji7WZcw2v_-sLttb9rJpCxBWhRcd0kO4lmCjcK6
AUtHRiTOzZUcAIsPpa-aqllAo_-NeDqCPHJYcGZRJtXBGitfLwRtYKZE
V2mCuQhWeq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0a9Gr3dc6LvW6yDB_KtUJbvWId0V6hzeLBxZ793OC8GcXW2olV_dI7
M9AeQ11lQT7hbGxgdszp8aDP8pnlHLi_EhBASRrM4AQabGpW8cgC5wnO
GeF-8Sqb-ULJjvK3GEaPnfAvl-rT2L8vYTCRpOg6Ndy8_LBZ5Iq0QgzQ
d1ISqXW_EW1T2NR7E2YI3NJwcwVz5aoz8htwzwcfT0T_Z5wJ1ivSW-Gd
pk4iU_fGuQ
外观
\\APP401\I\Run\Folder\Client\20171031\25490175\Data\brtbvsch\
我很难弄清楚如何在UNC路径中的第一个\\之后添加字符串。
答案 0 :(得分:1)
您可以使用正则表达式替换来完成此操作:
Join-Path -path "\\10.0.0.1\share" -ChildPath "\\APP401\I\Run\Folder\Client\20171031\25490175\Data\brtbvsch\".TrimStart('\')
您也可以按照Olaf的建议使用Join-Path:
$Path = "\\APP401\I\Run\Folder\Client\20171031\25490175\Data\brtbvsch\"
$Path -replace "^\\",'\\10.0.0.1\share'
如果您的子路径也位于变量中,则上述两种解决方案均适用:
Join-Path -Path "\\10.0.0.1\share" -ChildPath $Path.TrimStart('\')
或者:
rep
答案 1 :(得分:0)
务实的解决方案是简单的字符串连接,因为路径中的{strong> \
重复是良性的(多个{ {1}}被视为单个\
;例如,尝试\
。
Get-ChildItem C:\\Windows