mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-11-22 07:53:21 +01:00
Update list-cli-tools.ps1
This commit is contained in:
parent
a3978dd37c
commit
43bbf406d7
@ -57,24 +57,19 @@ BLAST,Balloon-borne Large Aperture Submillimeter Telescope
|
|||||||
BlackGEM,(La Silla) Telescope array searching for optical counterparts of gravitational wave sources
|
BlackGEM,(La Silla) Telescope array searching for optical counterparts of gravitational wave sources
|
||||||
BLIP,Background photon noise limited
|
BLIP,Background photon noise limited
|
||||||
C2PAP,"Computational Center for Particle and Astrophysics, Universe Cluster, Garching"
|
C2PAP,"Computational Center for Particle and Astrophysics, Universe Cluster, Garching"
|
||||||
CAD,Computer Aided Design
|
|
||||||
CADC,Canadian Astronomy Data Centre
|
CADC,Canadian Astronomy Data Centre
|
||||||
CAPj,Communicating Astronomy with the Public Journal
|
CAPj,Communicating Astronomy with the Public Journal
|
||||||
CARLA,Clusters Around Radio-Loud AGN (Spitzer)
|
CARLA,Clusters Around Radio-Loud AGN (Spitzer)
|
||||||
CASA,Common Astronomy Software Applications (ALMA)
|
CASA,Common Astronomy Software Applications (ALMA)
|
||||||
CBR,cosmic background radiation
|
CBR,cosmic background radiation
|
||||||
CCD,Charge Coupled Device
|
|
||||||
CDR,Critical Design Review
|
CDR,Critical Design Review
|
||||||
CDS,"Centre de Données astronomiques de Strasbourg (Strasbourg astronomical Data Center)"
|
CDS,"Centre de Données astronomiques de Strasbourg (Strasbourg astronomical Data Center)"
|
||||||
CEA,"Commissariat à L’Energie Atomique, France"
|
CEA,"Commissariat à L’Energie Atomique, France"
|
||||||
CELAC_EU,"Summit of the Community of Latin American and Caribbean States–European Union"
|
CELAC_EU,"Summit of the Community of Latin American and Caribbean States–European Union"
|
||||||
CES,Coude Echelle Spectrometer
|
CES,Coude Echelle Spectrometer
|
||||||
CfP,Call for Proposal
|
|
||||||
CfT,Call for tender
|
|
||||||
CGM,Circumgalactic medium
|
CGM,Circumgalactic medium
|
||||||
CHAMP+,Dual channel heterodyne receiver array (APEX)
|
CHAMP+,Dual channel heterodyne receiver array (APEX)
|
||||||
CLIF,Convolution with Linearized Inverse Filter algorithm for wavefront sensing
|
CLIF,Convolution with Linearized Inverse Filter algorithm for wavefront sensing
|
||||||
CLP,Chilean Peso
|
|
||||||
CM,center of mass
|
CM,center of mass
|
||||||
CMB,Cosmic Microwave Background
|
CMB,Cosmic Microwave Background
|
||||||
CMBR,Cosmic Microwave Background Radiation
|
CMBR,Cosmic Microwave Background Radiation
|
||||||
|
|
@ -433,8 +433,7 @@ CBT,Changed Block Tracking
|
|||||||
CBT,Computer-Based Training
|
CBT,Computer-Based Training
|
||||||
CC,Common Criteria
|
CC,Common Criteria
|
||||||
CCB,Change Control Board
|
CCB,Change Control Board
|
||||||
CCD,charge-coupled device
|
CCD,"Charge-Coupled Device, Continuity of Care Document"
|
||||||
CCD,Continuity of Care Document
|
|
||||||
CCEVS,Common Criteria Evaluation and Validation Scheme for IT Security
|
CCEVS,Common Criteria Evaluation and Validation Scheme for IT Security
|
||||||
CCIE,Cisco Certified Internetwork Expert
|
CCIE,Cisco Certified Internetwork Expert
|
||||||
CCITT,ITU-T Telecommunication Standardization Sector of the International Telecommunications
|
CCITT,ITU-T Telecommunication Standardization Sector of the International Telecommunications
|
||||||
|
|
@ -670,7 +670,7 @@ CC,carbon copy
|
|||||||
CCA,Counter Command Activity
|
CCA,Counter Command Activity
|
||||||
CCC,"Canterbury Clothing Company,Civilian Conservation Corps (U.S.,1930s and 1940s),Corpus Christi College,Oxford"
|
CCC,"Canterbury Clothing Company,Civilian Conservation Corps (U.S.,1930s and 1940s),Corpus Christi College,Oxford"
|
||||||
CCCP,"Central Committee of the Communist Party,Cyrillic for SSSR (Soyuz Sovetskikh Sotsialisticheskikh Respublik,Russian Союз Советских Социалистических Республик,Union of Soviet Socialist Republics)"
|
CCCP,"Central Committee of the Communist Party,Cyrillic for SSSR (Soyuz Sovetskikh Sotsialisticheskikh Respublik,Russian Союз Советских Социалистических Республик,Union of Soviet Socialist Republics)"
|
||||||
CCD,"Charge-Coupled Device,Confraternity of Christian Doctrine (Catechism)"
|
CCD,Confraternity of Christian Doctrine (Catechism)
|
||||||
CCF,Cartoon Cartoon Fridays
|
CCF,Cartoon Cartoon Fridays
|
||||||
CCG,"Canadian Coast Guard,Collectible Card Game"
|
CCG,"Canadian Coast Guard,Collectible Card Game"
|
||||||
CCGC,"Canadian Coast Guard Cutter,Canadian Coast Guard College"
|
CCGC,"Canadian Coast Guard Cutter,Canadian Coast Guard College"
|
||||||
|
Can't render this file because it has a wrong number of fields in line 7.
|
@ -6,9 +6,9 @@
|
|||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./list-cli-tools.ps1
|
PS> ./list-cli-tools.ps1
|
||||||
|
|
||||||
Tool Version Path FileSize
|
CLI-Tool Version Location
|
||||||
---- ------- ---- --------
|
-------- ------- --------
|
||||||
at 10.0.19041.1 C:\WINDOWS\system32\at.exe 31232
|
at 10.0.19041.1 C:\WINDOWS\system32\at.exe (31K)
|
||||||
...
|
...
|
||||||
.LINK
|
.LINK
|
||||||
https://github.com/fleschutz/PowerShell
|
https://github.com/fleschutz/PowerShell
|
||||||
@ -16,7 +16,19 @@
|
|||||||
Author: Markus Fleschutz | License: CC0
|
Author: Markus Fleschutz | License: CC0
|
||||||
#>
|
#>
|
||||||
|
|
||||||
function ListTool { param([string]$Name, [string]$VersionArg)
|
function Bytes2String([int64]$bytes) {
|
||||||
|
if ($bytes -lt 1000) { return "$bytes bytes" }
|
||||||
|
$bytes /= 1000
|
||||||
|
if ($bytes -lt 1000) { return "$($bytes)K" }
|
||||||
|
$bytes /= 1000
|
||||||
|
if ($bytes -lt 1000) { return "$($bytes)MB" }
|
||||||
|
$bytes /= 1000
|
||||||
|
if ($bytes -lt 1000) { return "$($bytes)GB" }
|
||||||
|
$bytes /= 1000
|
||||||
|
return "$($Bytes)TB"
|
||||||
|
}
|
||||||
|
|
||||||
|
function ListTool([string]$Name, [string]$VersionArg) {
|
||||||
try {
|
try {
|
||||||
$Info = Get-Command $Name -ErrorAction Stop
|
$Info = Get-Command $Name -ErrorAction Stop
|
||||||
$Path = $Info.Source
|
$Path = $Info.Source
|
||||||
@ -41,7 +53,7 @@ function ListTool { param([string]$Name, [string]$VersionArg)
|
|||||||
} else {
|
} else {
|
||||||
$Size = 0
|
$Size = 0
|
||||||
}
|
}
|
||||||
New-Object PSObject -Property @{ Tool=$Name; Version=$Version; Path=$Path; FileSize=$Size }
|
New-Object PSObject -Property @{ 'CLI-Tool'=$Name; Version=$Version; Location="$Path ($(Bytes2String $Size))" }
|
||||||
} catch {
|
} catch {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
@ -313,7 +325,7 @@ function ListTools {
|
|||||||
}
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
ListTools | Format-Table -property @{e='Tool';width=12},@{e='Version';width=15},@{e='Path';width=70},@{e='FileSize';width=10}
|
ListTools | Format-Table -property @{e='CLI-Tool';width=14},@{e='Version';width=17},@{e='Location';width=90}
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
|
||||||
|
Loading…
Reference in New Issue
Block a user