mirror of
https://github.com/serialexperiments0815/PowershellExcercises.git
synced 2026-07-12 15:32:25 +00:00
10 lines
543 B
PowerShell
10 lines
543 B
PowerShell
# Exports CSV file containing all installed programms
|
|
|
|
# Test-Path added to avoid Remove-Item error on first execution.
|
|
# Remove-Item was added to avoid complications with Export-Csv function.
|
|
# Delimiter was added to not have all properties stacked in the same column.
|
|
if (Test-Path "$($PSScriptRoot)/InstalledPrograms.csv"){
|
|
Remove-Item -Path "$($PSScriptRoot)/InstalledPrograms.csv"
|
|
}
|
|
Get-Package | Select-Object -Property Name, Version, Summary |
|
|
Export-Csv -Path "$($PSScriptRoot)/InstalledPrograms.csv" -NoTypeInformation -Delimiter ";"
|