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

  • Windows 上帝模式 / God Mode
  • 討厭的 LibreOffice 段落排版一次搞定 😎
  • ASP.NET Core WebAPI
  • 沒有任何防備,突然被指派為 SQL Server 管理員的求生指南
  • SQL Server Group Managed Service Account As Service Identity (gMSA)

Categories

  • Blog3
  • Cloud2
  • CyberSecurity26
  • Database140
  • Design1
  • Dev212
  • IIS39
  • LearningNote24
  • LifeHack9
  • Microsoft1
  • Misc42
  • Mobile1
  • Network10
  • News1
  • OS68
  • Office13
  • PowerBI9
  • Resource11
  • Toys22
  • TroubleShooting4
  • Vue13

Archives

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