Mein Code erstellt ist:Out-File -force werden Zwischen Verzeichnisse nicht
$path = "c:\no-such-dir\00.txt"
"foo" | Out-File -force -filePath $path
Der Fehler:
Out-File : Could not find a part of the path 'C:\no-such-dir\00.txt'
Hilfe out-Datei, um sie -volle
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.
So scheint es sollte "No-so-dir" erstellen, aber es tut nicht. Was geschieht?
Sind Sie sicher, dass es für Sie arbeitet? Ich verwende PowerShell v2 und es funktioniert nicht. – alex2k8
Ich habe es versucht. aber ich habe den Fehler gemacht zu vergessen, das Zwischenverzeichnis zu löschen, sorry. – zdan
New-Item funktioniert perfekt, danke! – alex2k8