更新时间:2023-11-29 19:55:16
if 是 [string]
类型:
$file.Substring(0, $file.LastIndexOf('.'))
如果是 [system.io.fileinfo]
类型:
join-path $File.DirectoryName $file.BaseName
或者你可以投射它:
join-path ([system.io.fileinfo]$File).DirectoryName ([system.io.fileinfo]$file).BaseName