The Skeptical Software Engineer

Home Categories Tags Apps About
2022-03-03
OS

PowerShell Get Folders And Files Size


  1. 說明
    1. 路徑下所有檔案的大小
    2. 資料夾檔案總和
  2. 相關連結
  3. 參考資料

說明如何使用 PowerShell 計算資料夾與檔案的大小。

logo

說明

路徑下所有檔案的大小

get-childitem | select name, @{Name='FileSize'; Exp = {"{0:N0}" -f ($_.Length / 1KB)}}

資料夾檔案總和

(get-childitem c:\users\sdwh\ | measure Length -s).sum / 1MB

相關連結

PowerShell 使用者不能錯過的 5 個技巧

Powershell 使用物件與資料結構 (Array, Hash)

PowerShell 常用指令筆記

參考資料

MSDocs - Invoke-WebRequest

Share
  • Microsoft
  • PowerShell
  • Windows
Older
發送電子郵件的技巧 📧 (Mail Sending Tricks)
Newer
Western Cuisines

Recent Posts

  • C# Linq To Sqlite (Linq to SQL)
  • 初探 Clean Code
  • 十步驟學習法 (Ten Steps To Learn Anything Quickly)
  • C# Tuple
  • C# Dictionary

Categories

  • Blog3
  • Cloud2
  • CyberSecurity26
  • DEV1
  • Database136
  • Design1
  • Dev182
  • IIS38
  • LearningNote24
  • LifeHack8
  • Microsoft1
  • Misc35
  • Mobile1
  • Network9
  • News1
  • OS63
  • Office11
  • PowerBI8
  • Resource11
  • Toys22
  • TroubleShooting4
  • Vue13

Archives

  • 202311
  • 2022218
  • 2021243
  • 2020128
The Skeptical Software Engineer © 2020 - Powered by Hexo
Home Categories Tags Apps About