我需要檢查一個文件夾,使所有的不同的擴展 數組(這部分去WEL)目錄的foreach擴展的PowerShell
$dir = dir C:\Users\seppe\Desktop\School\Scripting\Lab06\scripting_Lab06_opdr3 | Group-Object -property extension | Format-Table -Property Name
現在這裏的問題是:這個數組我需要做一個製作不同文件夾的foreach。文件夾的名稱需要是不同類型的文件(如:DOC我有這樣的:
foreach($_ in $dir){
mkdir C:\Users\seppe\Desktop\School\Scripting\Lab06\scripting_Lab06_opdr3\$_
}
,但我得到5(在我來說,我只需要3(因爲療法3種類型的文件,在文件夾))文件夾,但絲毫這個名字:
Microsoft.PowerShell.Commands.Internal.Format.FormatEndData
Microsoft.PowerShell.Commands.Internal.Format.FormatEntryData
Microsoft.PowerShell.Commands.Internal.Format.FormatStartData
Microsoft.PowerShell.Commands.Internal.Format.GroupEndData
Microsoft.PowerShell.Commands.Internal.Format.GroupStartData
這確實有點準確,因爲現在我有一個dir PNG而不是.PNG –