本人正在使用的是 Windows 10 家庭版,不知道以前 win + x
以后出现的 命令提示符CMD
全更新成了 PowerShell
,用起来比 CMD 舒服多了,至少看起来界面不再是黑白色的了。之后搜了搜关于它的信息,很强。。
将下面代码粘贴到 PS 里面执行
# create new excel instance $objExcel = New-Object -comobject Excel.Application $objExcel.Visible = $True $objWorkbook = $objExcel.Workbooks.Add() $objWorksheet = $objWorkbook.Worksheets.Item(1) # write information to the excel file $i = 0 $first10 = (ps | sort ws -Descending | select -first 10) $first10 | foreach -Process {$i++; $objWorksheet.Cells.Item($i,1) = $_.name; $objWorksheet.Cells.Item($i,2) = $_.ws} $otherMem = (ps | measure ws -s).Sum - ($first10 | measure ws -s).Sum $objWorksheet.Cells.Item(11,1) = "Others"; $objWorksheet.Cells.Item(11,2) = $otherMem # draw the pie chart $objCharts = $objWorksheet.ChartObjects() $objChart = $objCharts.Add(0, 0, 500, 300) $objChart.Chart.SetSourceData($objWorksheet.range("A1:B11"), 2) $objChart.Chart.ChartType = 70 $objChart.Chart.ApplyDataLabels(5)```  [更多命令](https://www.ithome.com/html/win10/315277.htm)
欢迎来到这里!
我们正在构建一个小众社区,大家在这里相互信任,以平等 • 自由 • 奔放的价值观进行分享交流。最终,希望大家能够找到与自己志同道合的伙伴,共同成长。
注册 关于