摘要:系统运维 Function Sort-List {param($list)write "Before sorting"write "$list"$len = $list.Countforeach ($i in $list) {foreach (
系统运维
Function Sort-List {
param($list)
write "Before sorting"
write "$list"
$len = $list.Count
foreach ($i in $list) {
foreach ($j in @(0..($len -2))) {
if ($list[$j] -gt $list[$j+1]) {
$list[$j],$list[$j+1] = $list[$j+1],$list[$j]
}
}
}
write $("-" * 3)
write "After sorting"
return $list
}
$newlist = @(1..20) | Get-Random -Count 10
write "$(Sort-List $newlist)"
相关文章推荐
虚拟主机的专业参数,分别都是什么意思?2022-09-09
中非域名注册规则是怎样的?注册域名有什么用处? 2022-01-10
HostEase新年活动促销 美国/香港主机全场低至五折2021-12-28
HostGator下载完整备份教程分享2021-12-28
Flink中有界数据与无界数据的示例分析2021-12-28