2020-09-10 14:34:08 +03:00
param (
[ Parameter ( Mandatory )][ string ]
$OutputDirectory ,
$ImageName
)
2020-10-07 17:14:00 +03:00
$ErrorActionPreference = "Stop"
2020-09-10 14:34:08 +03:00
Import-Module MarkdownPS
Import-Module " $PSScriptRoot /SoftwareReport.Common.psm1" -DisableNameChecking
Import-Module " $PSScriptRoot /SoftwareReport.Xcode.psm1" -DisableNameChecking
Import-Module " $PSScriptRoot /SoftwareReport.Android.psm1" -DisableNameChecking
Import-Module " $PSScriptRoot /SoftwareReport.Java.psm1" -DisableNameChecking
Import-Module " $PSScriptRoot /SoftwareReport.Xamarin.psm1" -DisableNameChecking
Import-Module " $PSScriptRoot /SoftwareReport.Toolcache.psm1" -DisableNameChecking
Import-Module " $PSScriptRoot /SoftwareReport.Browsers.psm1" -DisableNameChecking
2021-01-26 17:14:31 +03:00
Import-Module " $PSScriptRoot /SoftwareReport.WebServers.psm1" -DisableNameChecking
2020-09-10 14:34:08 +03:00
Import-Module " $PSScriptRoot /../helpers/SoftwareReport.Helpers.psm1"
Import-Module " $PSScriptRoot /../helpers/Common.Helpers.psm1"
Import-Module " $PSScriptRoot /../helpers/Xcode.Helpers.psm1"
# Operating System info
$os = Get-OSVersion
$markdown = ""
# OS info
$markdown += Build-OSInfoSection
$markdown += New-MDList -Style Unordered -Lines ( "Image Version: {0}" -f $ImageName . Split ( '_' )[ 1 ])
# Software report
$markdown += New-MDHeader "Installed Software" -Level 2
$markdown += New-MDHeader "Language and Runtime" -Level 3
2021-01-19 18:44:12 +03:00
$languageAndRuntimeList = @ (
2021-12-13 12:49:56 +03:00
( Get-BashVersion )
( Get-MSBuildVersion )
( Get-NodeVersion )
( Get-NVMVersion )
( Get-NVMNodeVersionList )
( Get-PerlVersion )
( Get-PythonVersion )
( Get-Python3Version )
( Get-RubyVersion )
( Get-DotnetVersionList )
( Get-GoVersion )
( Get-JuliaVersion )
( Get-KotlinVersion )
( Get-PHPVersion )
( Get-ClangLLVMVersion )
( Get-GccVersion )
2021-12-08 00:35:25 +03:00
( Get-FortranVersion )
2022-02-04 21:00:07 +03:00
( Get-RVersion )
2020-09-10 14:34:08 +03:00
)
2021-05-13 11:45:33 +03:00
# To sort GCC and Gfortran correctly, we need to use natural sort https://gist.github.com/markwragg/e2a9dc05f3464103d6998298fb575d4e#file-sort-natural-ps1
$toNatural = { [ regex ]:: Replace ( $_ , '\d+' , { $args [ 0 ]. Value . PadLeft ( 20 ) }) }
$markdown += New-MDList -Style Unordered -Lines ( $languageAndRuntimeList | Sort-Object $toNatural )
2021-01-19 18:44:12 +03:00
# Package Management
$markdown += New-MDHeader "Package Management" -Level 3
$packageManagementList = @ (
2020-12-28 11:15:54 +03:00
( Get-PipVersion -Version 2 ),
( Get-PipVersion -Version 3 ),
( Get-PipxVersion ),
( Get-BundlerVersion ),
( Get-CocoaPodsVersion ),
2022-06-06 14:39:50 +02:00
( Get-CondaVersion ),
2020-12-28 11:15:54 +03:00
( Get-HomebrewVersion ),
( Get-NPMVersion ),
( Get-YarnVersion ),
( Get-NuGetVersion ),
( Get-RubyGemsVersion ),
2021-12-02 18:35:56 +03:00
( Get-ComposerVersion ),
2021-12-30 10:36:59 +03:00
( Get-CarthageVersion ),
( Get-VcpkgVersion )
2020-09-10 14:34:08 +03:00
)
2021-01-19 18:44:12 +03:00
$markdown += New-MDList -Style Unordered -Lines ( $packageManagementList | Sort-Object )
2022-06-06 14:39:50 +02:00
$markdown += New-MDHeader "Environment variables" -Level 4
$markdown += Build-PackageManagementEnvironmentTable | New-MDTable
$markdown += New-MDNewLine
2020-09-10 14:34:08 +03:00
# Project Management
$markdown += New-MDHeader "Project Management" -Level 3
2021-01-19 18:44:12 +03:00
$markdown += New-MDList -Style Unordered -Lines ( @ (
2020-12-28 11:15:54 +03:00
( Get-MavenVersion ),
( Get-GradleVersion ),
2021-09-21 12:49:59 +03:00
( Get-ApacheAntVersion ),
( Get-SbtVersion )
2021-01-19 18:44:12 +03:00
) | Sort-Object
2020-09-10 14:34:08 +03:00
)
# Utilities
$markdown += New-MDHeader "Utilities" -Level 3
2021-01-19 18:44:12 +03:00
$utilitiesList = @ (
2020-12-28 11:15:54 +03:00
( Get-CurlVersion ),
( Get-GitVersion ),
( Get-GitLFSVersion ),
( Get-GitHubCLIVersion ),
( Get-HubVersion ),
( Get-WgetVersion ),
( Get-SVNVersion ),
( Get-PackerVersion ),
( Get-OpenSSLVersion ),
( Get-JqVersion ),
( Get-PostgresClientVersion ),
( Get-PostgresServerVersion ),
( Get-Aria2Version ),
( Get-AzcopyVersion ),
( Get-ZstdVersion ),
( Get-BazelVersion ),
( Get-BazeliskVersion ),
( Get-MongoVersion ),
( Get-MongodVersion ),
( Get - 7zipVersion ),
( Get-BsdtarVersion ),
2021-12-02 18:35:56 +03:00
( Get-GnuTarVersion ),
( Get-GPGVersion ),
( Get-SwitchAudioOsxVersion ),
2022-03-23 11:20:36 +01:00
( Get-SoxVersion ),
2022-05-02 11:05:31 +02:00
( Get-YqVersion ),
( Get-ImageMagickVersion )
2020-09-10 14:34:08 +03:00
)
2021-01-19 18:44:12 +03:00
2021-09-24 13:56:16 +03:00
if ( $os . IsLessThanMonterey ) {
$utilitiesList += @ (
( Get-HelmVersion )
)
}
2021-12-30 10:36:59 +03:00
if ( $os . IsLessThanMonterey ) {
2021-01-19 18:44:12 +03:00
$utilitiesList += @ (
( Get-NewmanVersion )
)
2020-09-21 09:46:17 +03:00
}
2021-01-19 18:44:12 +03:00
2021-12-30 10:36:59 +03:00
if ( $os . IsCatalina ) {
2021-01-19 18:44:12 +03:00
$utilitiesList += @ (
2020-12-28 11:15:54 +03:00
( Get-ParallelVersion )
2020-09-22 12:12:44 +03:00
)
2020-09-10 14:34:08 +03:00
}
2021-01-19 18:44:12 +03:00
2022-05-24 23:48:57 +04:00
if ( -not $os . IsBigSur ) {
$utilitiesList += @ (
2022-07-04 14:35:52 +04:00
( Get-VagrantVersion ),
2022-05-24 23:48:57 +04:00
( Get-VirtualBoxVersion )
)
}
2021-01-19 18:44:12 +03:00
$markdown += New-MDList -Style Unordered -Lines ( $utilitiesList | Sort-Object )
2020-09-10 14:34:08 +03:00
# Tools
$markdown += New-MDHeader "Tools" -Level 3
2021-01-19 18:44:12 +03:00
$toolsList = @ (
2021-10-27 16:48:10 +03:00
( Get-JazzyVersion ),
2020-12-28 11:15:54 +03:00
( Get-FastlaneVersion ),
( Get-CmakeVersion ),
( Get-AppCenterCLIVersion ),
( Get-AzureCLIVersion ),
2022-02-11 12:53:36 +03:00
( Get-AzureDevopsVersion ),
2020-12-28 11:15:54 +03:00
( Get-AWSCLIVersion ),
( Get-AWSSAMCLIVersion ),
2021-09-24 13:56:16 +03:00
( Get-AWSSessionManagerCLIVersion )
)
if ( $os . IsLessThanMonterey ) {
$toolsList += @ (
( Get-AliyunCLIVersion )
)
}
$toolsList += @ (
2021-06-07 16:00:50 +03:00
( Get-XcodeCommandLineToolsVersion ),
2021-07-07 09:10:31 -05:00
( Get-SwigVersion ),
2021-11-18 17:23:05 +03:00
( Get-BicepVersion ),
( Get-GHCupVersion ),
( Get-GHCVersion ),
( Get-CabalVersion ),
2022-05-06 09:15:33 +02:00
( Get-StackVersion ),
( Get-SwiftFormatVersion )
2020-09-10 14:34:08 +03:00
)
2021-01-19 18:44:12 +03:00
$markdown += New-MDList -Style Unordered -Lines ( $toolsList | Sort-Object )
2020-09-10 14:34:08 +03:00
# Linters
$markdown += New-MDHeader "Linters" -Level 3
2021-01-19 18:44:12 +03:00
$lintersList = @ (
2021-11-18 17:23:05 +03:00
( Get-YamllintVersion ),
( Get-SwiftLintVersion )
2020-09-10 14:34:08 +03:00
)
2021-01-19 18:44:12 +03:00
$markdown += New-MDList -Style Unordered -Lines ( $lintersList | Sort-Object )
2020-09-10 14:34:08 +03:00
$markdown += New-MDHeader "Browsers" -Level 3
$markdown += Get-BrowserSection
2021-02-08 11:45:16 +05:00
$markdown += New-MDHeader "Environment variables" -Level 4
$markdown += Build-BrowserWebdriversEnvironmentTable | New-MDTable
$markdown += New-MDNewLine
2020-09-10 14:34:08 +03:00
$markdown += New-MDHeader "Java" -Level 3
$markdown += Get-JavaVersions | New-MDTable
2021-01-19 18:44:12 +03:00
$markdown += New-MDNewLine
2020-09-10 14:34:08 +03:00
2022-02-02 11:02:55 +03:00
$markdown += New-MDHeader "GraalVM" -Level 3
$markdown += Build-GraalVMTable | New-MDTable
$markdown += New-MDNewLine
2020-09-10 14:34:08 +03:00
# Toolcache
$markdown += Build-ToolcacheSection
2021-11-25 10:20:15 +03:00
$markdown += New-MDNewLine
2020-09-10 14:34:08 +03:00
2021-11-18 17:23:05 +03:00
$markdown += New-MDHeader "Rust Tools" -Level 3
$markdown += New-MDList -Style Unordered -Lines ( @ (
( Get-RustVersion ),
( Get-RustupVersion ),
( Get-RustdocVersion ),
( Get-RustCargoVersion )
) | Sort-Object
)
$markdown += New-MDHeader "Packages" -Level 4
$markdown += New-MDList -Style Unordered -Lines ( @ (
( Get-Bindgen ),
( Get-Cbindgen ),
( Get-Cargooutdated ),
( Get-Cargoaudit ),
( Get-RustfmtVersion ),
( Get-RustClippyVersion )
) | Sort-Object
)
2020-09-10 14:34:08 +03:00
$markdown += New-MDHeader "PowerShell Tools" -Level 3
2020-12-28 11:15:54 +03:00
$markdown += New-MDList -Lines ( Get-PowershellVersion ) -Style Unordered
2020-09-10 14:34:08 +03:00
$markdown += New-MDHeader "PowerShell Modules" -Level 4
$markdown += Get-PowerShellModules | New-MDTable
$markdown += New-MDNewLine
2021-01-26 17:14:31 +03:00
# Web Servers
2021-12-30 10:36:59 +03:00
$markdown += Build-WebServersSection
2021-01-26 17:14:31 +03:00
2020-09-10 14:34:08 +03:00
# Xamarin section
$markdown += New-MDHeader "Xamarin" -Level 3
2022-05-26 17:05:57 +02:00
$markdown += New-MDHeader "Visual Studio for Mac" -Level 4
$markdown += Build-VSMacTable | New-MDTable
$markdown += New-MDNewLine
2022-06-13 16:49:22 +02:00
if ( -not $os . IsCatalina ) {
2022-06-07 10:37:38 +04:00
$markdown += New-MDHeader "Notes:" -Level 5
$reportVS = @'
```
To use Visual Studio 2019 by default rename the app:
2022-06-14 13:14:05 +02:00
mv "/Applications/Visual Studio.app" "/Applications/Visual Studio 2022.app"
mv "/Applications/Visual Studio 2019.app" "/Applications/Visual Studio.app"
2022-06-07 10:37:38 +04:00
```
'@
$markdown += New-MDParagraph -Lines $reportVS
}
2020-09-10 14:34:08 +03:00
2021-04-08 12:55:47 +03:00
$markdown += New-MDHeader "Xamarin bundles" -Level 4
$markdown += Build-XamarinTable | New-MDTable
$markdown += New-MDNewLine
2020-09-10 14:34:08 +03:00
$markdown += New-MDHeader "Unit Test Framework" -Level 4
$markdown += New-MDList -Lines @ ( Get-NUnitVersion ) -Style Unordered
2020-10-02 09:20:15 +03:00
# First run doesn't provide full data about devices and runtimes
Get-XcodeInfoList | Out-Null
2020-09-10 14:34:08 +03:00
# Xcode section
$xcodeInfo = Get-XcodeInfoList
$markdown += New-MDHeader "Xcode" -Level 3
$markdown += Build-XcodeTable $xcodeInfo | New-MDTable
$markdown += New-MDNewLine
$markdown += Build-XcodeSupportToolsSection
$markdown += New-MDHeader "Installed SDKs" -Level 4
$markdown += Build-XcodeSDKTable $xcodeInfo | New-MDTable
$markdown += New-MDNewLine
2020-10-02 09:20:15 +03:00
$markdown += New-MDHeader "Installed Simulators" -Level 4
$markdown += Build-XcodeSimulatorsTable $xcodeInfo | New-MDTable
$markdown += New-MDNewLine
2020-09-10 14:34:08 +03:00
# Android section
$markdown += New-MDHeader "Android" -Level 3
2021-07-14 10:02:12 +03:00
$androidTable = Build-AndroidTable
2021-12-30 10:36:59 +03:00
if ( $os . IsCatalina ) {
2021-07-14 10:02:12 +03:00
$androidTable += Get-IntelHaxmVersion
}
$markdown += $androidTable | New-MDTable
2020-09-10 14:34:08 +03:00
$markdown += New-MDNewLine
2021-02-08 11:45:16 +05:00
$markdown += New-MDHeader "Environment variables" -Level 4
$markdown += Build-AndroidEnvironmentTable | New-MDTable
$markdown += New-MDNewLine
2020-09-10 14:34:08 +03:00
2021-12-17 23:47:47 +03:00
$markdown += New-MDHeader "Miscellaneous" -Level 3
2021-12-20 22:07:41 +03:00
$markdown += New-MDList -Style Unordered -Lines ( @ (
( Get-ZlibVersion ),
( Get-LibXextVersion ),
2022-02-07 11:12:13 +03:00
( Get-LibXftVersion ),
( Get-TclTkVersion )
2021-12-20 22:07:41 +03:00
) | Sort-Object
)
2021-12-17 23:47:47 +03:00
2020-09-10 14:34:08 +03:00
#
# Generate systeminfo.txt with information about image (for debug purpose)
#
$dateTime = ( Get-Date ). ToString ( "yyyy-MM-dd HH:mm:ss" )
$systemInfo = [ string ]:: Join ([ System.Environment ]:: NewLine , @ (
"Date: ${dateTime} " ,
"Image name: ${ImageName} "
))
if ( -not ( Test-Path $OutputDirectory )) { New-Item -Path $OutputDirectory -ItemType Directory | Out-Null }
#
# Write final reports
#
Write-Host $markdownExtended
$systemInfo | Out-File -FilePath " ${OutputDirectory} /systeminfo.txt" -Encoding UTF8NoBOM
2020-12-10 13:15:39 +05:00
$markdown | Out-File -FilePath " ${OutputDirectory} /systeminfo.md" -Encoding UTF8NoBOM