目前,我有以下代码来创建多维数组列表(但我没有使用数组列表结婚,只需要一个免费添加到数组类型中):
$Installs = new-object system.collections.arraylist
$CVAFiles = get-childitem -path $HPImagingAssistantSoftPaqPath -filter *.cva | select fullname
foreach($CVAFile in $CVAFiles)
{
$CVAFileContents = get-content $($CVAFile).fullname -raw
$CVAFileContents -match '(?s).*?\[General\].*?SystemMustBeRebooted=(\d).*?\[Install Execution\].*?SilentInstall=(.*?)\n.*' | out-null
$s = $CVAFile.fullname.split("\")[-1].split(".")[0]
$Installs.add(@($Matches[1],$s,$Matches[2])) | out-null}
}
但由于它是多维的,似乎无法使用$Installs.sort()使其按$Installs[1]排序。我似乎找不到任何其他在线排序多维数组列表的例子,以了解正确的语法是什么。
正确的语法是什么?