gpt4 book ai didi

powershell - 文件外强制,不创建中间目录

转载 作者:行者123 更新时间:2023-12-04 05:44:40 24 4
gpt4 key购买 nike

我的代码是:

$path = "c:\no-such-dir\00.txt"
"foo" | Out-File -force -filePath $path

错误:

Out-File : Could not find a part of the path 'C:\no-such-dir\00.txt'



帮助输出文件-完整

For example, Force will override the read-only attribute or create directories to complete a file path, but it will not attempt to change file permissions.



因此,似乎应该创建“no-such-dir”,但事实并非如此。怎么了?

最佳答案

这看起来像个错误。对于http://www.vistax64.com/powershell/62805-out-file-force-doesnt-seem-work-advertised.html,此问题已在MS Connect上提出。

关于powershell - 文件外强制,不创建中间目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/712074/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com