]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/tools/vcpkg/scripts/azure-pipelines/windows/disk-space.ps1
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / tools / vcpkg / scripts / azure-pipelines / windows / disk-space.ps1
1 # Copyright (c) Microsoft Corporation.
2 # SPDX-License-Identifier: MIT
3 #
4
5 <#
6 .SYNOPSIS
7 Prints total and free disk space for each disk on the system
8 #>
9
10 Function Format-Size {
11 [CmdletBinding()]
12 Param([long]$Size)
13
14 if ($Size -lt 1024) {
15 $Size = [int]$Size
16 return "$Size B"
17 }
18
19 $Size = $Size / 1024
20 if ($Size -lt 1024) {
21 $Size = [int]$Size
22 return "$Size KiB"
23 }
24
25 $Size = $Size / 1024
26 if ($Size -lt 1024) {
27 $Size = [int]$Size
28 return "$Size MiB"
29 }
30
31 $Size = [int]($Size / 1024)
32 return "$Size GiB"
33 }
34
35 Get-CimInstance -ClassName Win32_LogicalDisk | Format-Table -Property @{Label="Disk"; Expression={ $_.DeviceID }},@{Label="Label"; Expression={ $_.VolumeName }},@{Label="Size"; Expression={ Format-Size($_.Size) }},@{Label="Free Space"; Expression={ Format-Size($_.FreeSpace) }}