mirror of
https://github.com/dfinke/ImportExcel.git
synced 2025-12-06 00:23:20 +00:00
Added try/catch. Expanded aliases
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
|
||||
|
||||
$file = "disks.xlsx"
|
||||
|
||||
rm $file -ErrorAction Ignore
|
||||
Remove-Item $file -ErrorAction Ignore
|
||||
|
||||
$data = $(
|
||||
New-PSItem 100 -100
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
|
||||
|
||||
$file = "disks.xlsx"
|
||||
|
||||
rm $file -ErrorAction Ignore
|
||||
Remove-Item $file -ErrorAction Ignore
|
||||
|
||||
$data = $(
|
||||
New-PSItem 100 -100
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
|
||||
|
||||
$file = "disks.xlsx"
|
||||
|
||||
rm $file -ErrorAction Ignore
|
||||
Remove-Item $file -ErrorAction Ignore
|
||||
|
||||
$data = $(
|
||||
New-PSItem 1
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
|
||||
|
||||
$file = "disks.xlsx"
|
||||
|
||||
rm $file -ErrorAction Ignore
|
||||
Remove-Item $file -ErrorAction Ignore
|
||||
|
||||
$data = $(
|
||||
New-PSItem 100 -100
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
|
||||
|
||||
$file = "disks.xlsx"
|
||||
|
||||
rm $file -ErrorAction Ignore
|
||||
Remove-Item $file -ErrorAction Ignore
|
||||
|
||||
Get-CimInstance win32_logicaldisk -filter "drivetype=3" |
|
||||
Select DeviceID,Volumename,Size,Freespace |
|
||||
Get-CimInstance win32_logicaldisk -filter "drivetype=3" |
|
||||
Select-Object DeviceID,Volumename,Size,Freespace |
|
||||
Export-Excel -Path $file -Show -AutoSize -NumberFormat "0"
|
||||
@@ -1,7 +1,9 @@
|
||||
try {. $PSScriptRoot\..\..\LoadPSD1.ps1} catch {}
|
||||
|
||||
$file = "disks.xlsx"
|
||||
|
||||
rm $file -ErrorAction Ignore
|
||||
Remove-Item $file -ErrorAction Ignore
|
||||
|
||||
Get-CimInstance win32_logicaldisk -filter "drivetype=3" |
|
||||
Select DeviceID,Volumename,Size,Freespace |
|
||||
Get-CimInstance win32_logicaldisk -filter "drivetype=3" |
|
||||
Select-Object DeviceID,Volumename,Size,Freespace |
|
||||
Export-Excel -Path $file -Show -AutoSize
|
||||
BIN
Examples/NumberFormat/disks.xlsx
Normal file
BIN
Examples/NumberFormat/disks.xlsx
Normal file
Binary file not shown.
Reference in New Issue
Block a user