├── .gitattributes
├── .gitignore
├── .nuget
└── NuGet.Config
├── Build.ps1
├── DriverTool.sln
├── DriverTool.v3.ncrunchsolution
├── LICENSE
├── Notes.txt
├── PSMDConfig.ps1
├── README.md
├── doc
├── Dell MUP Command Line Options.txt
├── Dell Update Package Command Line Options.txt
├── HP EliteBook 830 G5 - Support.url
├── HP EliteBook 830 G5 Base Model bærbar PC - Drivernedlastinger - HP® Brukerstøtte.url
└── images
│ ├── DriverPackage_Drivers.png
│ ├── DriverPackage_Root.png
│ ├── InitialDriverPackage_CommandLine.png
│ ├── InitialDriverPackage_Create.png
│ ├── InitialDriverPackage_Drivers.png
│ ├── InitialDriverPackage_Root.png
│ ├── TaskSeqence-CM-Device-Drivers-Wmi-Query.png
│ ├── TaskSeqence-CM-Device-Drivers.png
│ ├── TaskSeqence-Device-Driver-Updates-1.png
│ ├── TaskSeqence-Device-Driver-Updates-2.png
│ ├── TaskSeqence-Device-Driver-Updates-Restart.png
│ └── TaskSeqence-Device-Driver-Updates-Wmi-Query.png
├── example_data
├── 20FA_Win7.xml
├── Dell_CatalogPC.xml
├── Dell_DriverPackCatalog.xml
├── HP_actionLog.xml
├── TestWindowsUpdateServicesApi
│ ├── TestWindowsUpdateServicesApi.sln
│ └── TestWindowsUpdateServicesApi
│ │ ├── App.config
│ │ ├── AssemblyInfo.fs
│ │ ├── Program.fs
│ │ ├── TestWindowsUpdateServicesApi.fsproj
│ │ └── packages.config
└── n1cww12w_2_.xml
├── modules
└── DriverTool.PowerCLI
│ ├── DriverTool.PowerCLI.Format.ps1xml
│ ├── DriverTool.PowerCLI.psd1
│ ├── DriverTool.PowerCLI.psm1
│ ├── LICENSE
│ ├── README.md
│ ├── en-us
│ └── about_DriverTool.PowerCLI.help.txt
│ ├── internal
│ ├── functions
│ │ ├── Assert-DtCmClientIsInstalled.ps1
│ │ ├── Assert-DtCmManagerConsoleIsInstalled.ps1
│ │ ├── Assert-DtFileExists.ps1
│ │ ├── Get-DtCmAssignedSite.ps1
│ │ ├── Get-DtCmCurrentManagementPoint.ps1
│ │ └── readme.md
│ ├── scripts
│ │ ├── postimport.ps1
│ │ ├── preimport.ps1
│ │ └── readme.md
│ └── tools
│ │ └── readme.md
│ └── public
│ ├── classes
│ └── readme.md
│ └── functions
│ ├── Connect-DtCmSite.ps1
│ ├── Get-DtCmDeviceModel.ps1
│ ├── Invoke-DtDriverTool.ps1
│ ├── New-DtCmPackageFromDriverPackPackageDefinition.ps1
│ ├── New-DtCmTaskSequenceFromDriverPackPackageDefinitionSms.ps1
│ └── readme.md
├── nuget.config
├── psakefile.ps1
├── revision.txt
├── scripts
└── OsSku2IsServerMatch.ps1
├── src
├── app
│ ├── DriverTool.CSharpLib
│ │ ├── DriverTool.CSharpLib.csproj
│ │ ├── WebParser.cs
│ │ └── Wintrust.cs
│ ├── DriverTool.DpInstExitCode2ExitCode
│ │ ├── DpInstExitCode.fs
│ │ ├── DriverTool.DpInstExitCode2ExitCode.fsproj
│ │ ├── F.fs
│ │ └── Program.fs
│ ├── DriverTool.DupExitCode2ExitCode
│ │ ├── App.config
│ │ ├── AssemblyInfo.fs
│ │ ├── DriverTool.DupExitCode2ExitCode.fsproj
│ │ ├── DriverTool.DupExitCode2ExitCode.v3.ncrunchproject
│ │ ├── Dup.fs
│ │ ├── F.fs
│ │ └── Program.fs
│ ├── DriverTool.Library
│ │ ├── AssemblyResolver.fs
│ │ ├── Async.fs
│ │ ├── BitLockerOperations.fs
│ │ ├── Cab.fs
│ │ ├── Checksum.fs
│ │ ├── CmUi
│ │ │ ├── UiModels.fs
│ │ │ └── UiViewModels.fs
│ │ ├── CompressDriverPackage.fs
│ │ ├── Compression.fs
│ │ ├── Configuration.fs
│ │ ├── CreateDriverPackage.fs
│ │ ├── Cryptography.fs
│ │ ├── CsvOperations.fs
│ │ ├── DellCatalog.fs
│ │ ├── DellCommandUpdate.fs
│ │ ├── DellDriverPackCatalog.fs
│ │ ├── DellSettings.fs
│ │ ├── DellUpdates.fs
│ │ ├── DirectoryOperations.fs
│ │ ├── DriverPack.fs
│ │ ├── DriverPacks.fs
│ │ ├── DriverTool.Library.fsproj
│ │ ├── DriverTool.Library.v3.ncrunchproject
│ │ ├── DriverUpdates.fs
│ │ ├── EmbeddedResource.fs
│ │ ├── Environment.fs
│ │ ├── ExportLocalUpdates.fs
│ │ ├── ExportRemoteUpdates.fs
│ │ ├── F.fs
│ │ ├── F0.fs
│ │ ├── FileOperations.fs
│ │ ├── FileSystem.fs
│ │ ├── HpCatalog.fs
│ │ ├── HpUpdates.fs
│ │ ├── HtmlHelper.fs
│ │ ├── Init.fs
│ │ ├── InstallDriverPackage.fs
│ │ ├── InstallXml.fs
│ │ ├── LenovoCatalog.fs
│ │ ├── LenovoCatalogXml.fs
│ │ ├── LenovoUpdates.fs
│ │ ├── Logging.fs
│ │ ├── Manufacturer.fs
│ │ ├── Messages.fs
│ │ ├── ModelCode.fs
│ │ ├── NCmdLinerMessenger.fs
│ │ ├── OperatingSystem.fs
│ │ ├── OperatingSystemCode.fs
│ │ ├── OperatingSystemOperations.fs
│ │ ├── PackageDefinitionSms.fs
│ │ ├── PackageDefintion.fs
│ │ ├── PackageTemplate.fs
│ │ ├── PackageTemplate
│ │ │ ├── Drivers
│ │ │ │ ├── DpInstExitCode2ExitCode.exe
│ │ │ │ ├── DpInstExitCode2ExitCode.exe.config
│ │ │ │ ├── DriverTool.DupExitCode2ExitCode.exe
│ │ │ │ ├── DriverTool.DupExitCode2ExitCode.exe.config
│ │ │ │ ├── Drivers-README.txt
│ │ │ │ └── FSharp.Core.dll
│ │ │ ├── Install.cmd
│ │ │ ├── Install.xml
│ │ │ ├── UnInstall.cmd
│ │ │ ├── _Compress.cmd
│ │ │ └── _Decompress.cmd
│ │ ├── PackageXml.fs
│ │ ├── Packaging.fs
│ │ ├── PathOperations.fs
│ │ ├── Paths.fs
│ │ ├── PowerShellHelper.fs
│ │ ├── ProcessOperations.fs
│ │ ├── RegExp.fs
│ │ ├── RegistryOperations.fs
│ │ ├── Requirements.fs
│ │ ├── Retry.fs
│ │ ├── Robocopy.fs
│ │ ├── Sccm.fs
│ │ ├── SdpUpdates.fs
│ │ ├── SystemFamily.fs
│ │ ├── SystemInfo.fs
│ │ ├── Tools
│ │ │ ├── 7Zip
│ │ │ │ ├── 7Zip.chm
│ │ │ │ ├── 7za.exe
│ │ │ │ ├── License.txt
│ │ │ │ └── readme.txt
│ │ │ └── BitLocker
│ │ │ │ ├── DriverTool Disable BitLocker Protection.cmd
│ │ │ │ └── DriverTool Resume BitLocker Protection.cmd
│ │ ├── Updates.fs
│ │ ├── UpdatesContext.fs
│ │ ├── Web.fs
│ │ ├── WebParsing.fs
│ │ ├── WmiHelper.fs
│ │ ├── WrappedString.fs
│ │ ├── XmlHelper.fs
│ │ └── XmlToolKit.fs
│ ├── DriverTool.PowerCLI.Library.CSharp
│ │ ├── CmdLets
│ │ │ └── SendGreetingCommand.cs
│ │ └── DriverTool.PowerCLI.Library.CSharp.csproj
│ ├── DriverTool.PowerCLI.Library.FSharp
│ │ ├── CmdLets
│ │ │ ├── Completers.fs
│ │ │ ├── Constants.fs
│ │ │ ├── Convert-DtExceptionToMessage.fs
│ │ │ ├── Data.fs
│ │ │ ├── Get-DtDriverPack.fs
│ │ │ ├── Get-DtDriverUpdates.fs
│ │ │ ├── Get-DtScriptNewCmPackageFromDriverPackPackageDefinitionSms.fs
│ │ │ ├── Get-DtScriptNewCmTaskSequenceFromDriverPackPackageDefinitionSms.fs
│ │ │ ├── Import-DtDriverPackPackageDefinitionSms.fs
│ │ │ ├── Invoke-DtDownloadDriverPack.fs
│ │ │ ├── Invoke-DtDownloadDriverUpdates.fs
│ │ │ └── Test-DtIsDriverUpdateRequired.fs
│ │ ├── Debug.txt
│ │ ├── DriverTool.PowerCLI.Library.FSharp.fsproj
│ │ ├── PowerShellProgress.fs
│ │ └── Properties
│ │ │ └── launchSettings.json
│ ├── DriverTool.UI
│ │ ├── App.config
│ │ ├── DriverTool.UI.csproj
│ │ ├── DriverTool.UI.v3.ncrunchproject
│ │ ├── DriverTool.ico
│ │ ├── ListViewExtensions.cs
│ │ ├── LoggerTraceListener.cs
│ │ ├── MainWindow.xaml
│ │ ├── MainWindow.xaml.cs
│ │ ├── Properties
│ │ │ ├── AssemblyInfo.cs
│ │ │ ├── Resources.Designer.cs
│ │ │ ├── Resources.resx
│ │ │ ├── Settings.Designer.cs
│ │ │ └── Settings.settings
│ │ ├── SelectedItemsBinder.cs
│ │ ├── StartUI.cs
│ │ └── packages.config
│ └── DriverTool
│ │ ├── App.config
│ │ ├── CommandDefinitions.fs
│ │ ├── CommandProviders.fs
│ │ ├── Credits
│ │ ├── 01. NCmdLiner Credit.xml
│ │ ├── 02. serilog Credit.xml
│ │ ├── 03. Nunit Credit.xml
│ │ ├── 04. CsvHelper Credit.xml
│ │ └── 05. mvvm-helpers Credit.xml
│ │ ├── Debug.txt
│ │ ├── DriverTool.fsproj
│ │ ├── DriverTool.ico
│ │ ├── DriverTool.v3.ncrunchproject
│ │ ├── Init.fs
│ │ ├── License
│ │ ├── 00. DriverTool License.xml
│ │ ├── 01. NCmLiner License.xml
│ │ ├── 02. serilog License.xml
│ │ ├── 03. NUnit License.xml
│ │ ├── 04. CsvHelper License.xml
│ │ └── 05. mvvm-helpers License.xml
│ │ ├── Program.fs
│ │ ├── Properties
│ │ └── launchSettings.json
│ │ ├── Run.fs
│ │ ├── RunCommand.fs
│ │ └── Script.fsx
├── graphics
│ ├── ConvertToIco.cmd
│ ├── DriverTool-128.png
│ ├── DriverTool-16.png
│ ├── DriverTool-256.png
│ ├── DriverTool-32.png
│ ├── DriverTool-64.png
│ ├── DriverTool.ico
│ ├── DriverTool.png
│ └── DriverTool.svg
└── test
│ ├── DriverTool.PowerCLI.Library.Tests
│ ├── DriverTool.PowerCLI.Library.Tests.fsproj
│ ├── ExampleTests.fs
│ └── Init.fs
│ └── DriverTool.Tests
│ ├── AssemblyInfo.fs
│ ├── AssemblyResolveTests.fs
│ ├── BitLockerOperationsTest.fs
│ ├── ChecksumTests.fs
│ ├── CompressionTests.fs
│ ├── CreateDriverPackageTests.fs
│ ├── CryptographyTests.fs
│ ├── CsvOperationTests.fs
│ ├── DellCommandUpdatesTests.fs
│ ├── DellDriverPackCatalogTests.fs
│ ├── DellUpdatesTests.fs
│ ├── DirectoryOperationTests.fs
│ ├── DpInstExitCode2ExitCodeTests.fs
│ ├── DriverTool.Tests.fsproj
│ ├── DriverTool.Tests.v3.ncrunchproject
│ ├── DriverUpdatesTests.fs
│ ├── EmbeddedResourceTest.fs
│ ├── EnvironmentTests.fs
│ ├── ExportRemoteUpdatesTests.fs
│ ├── FTests.fs
│ ├── FileOperationTests.fs
│ ├── HpCatalogTests.fs
│ ├── HpUpdatesTests.fs
│ ├── Init.fs
│ ├── InstallDriverPackageTests.fs
│ ├── InstallXmlTests.fs
│ ├── LenovoCatalogTests.fs
│ ├── LenovoCatalogXmlTests.fs
│ ├── LenovoUpdateTests.fs
│ ├── LoggingTests.fs
│ ├── ManufacturerTests.fs
│ ├── ModelCodeTests.fs
│ ├── OperatingSystemCodeTests.fs
│ ├── OperatingSystemTests.fs
│ ├── PackageDefintionSmsTests.fs
│ ├── PackageInfoTests.fs
│ ├── PackageTemplateTests.fs
│ ├── PackageXmlTests.fs
│ ├── PathOperationsTests.fs
│ ├── PathTests.fs
│ ├── PathsTests.fs
│ ├── ProcessOperationsTests.fs
│ ├── RegExpTests.fs
│ ├── RegistryOperationTests.fs
│ ├── SccmTests.fs
│ ├── TestData
│ ├── Cryptography
│ │ ├── n20ku13w_x64.exe
│ │ └── n20ku13w_x64_tampered.exe
│ ├── Dell
│ │ ├── ActivityLog.xml
│ │ └── DriverPackCatalog.xml
│ ├── HPCatalog
│ │ ├── HPClientDriverPackCatalog.xml
│ │ ├── HP_sp92489.html
│ │ ├── HP_sp95015.html
│ │ ├── HP_sp95xxx.html
│ │ └── HP_sp99341.html
│ ├── InstallXml
│ │ └── InstallXmlInstall.xml
│ ├── LenovoCatalog
│ │ ├── LenovoCatalog.xml
│ │ ├── LenovoCatalog_20FA_Win7.xml
│ │ ├── LenovoCatalog_WithErrorCorrected_20QG_win10.xml
│ │ ├── LenovoCatalog_WithError_20QG_win10.xml
│ │ ├── LenovoCatalog_catalogv2.xml
│ │ ├── LenovoCatalog_n1cx802w_2_.xml
│ │ ├── LenovoCatalog_v2.xml
│ │ └── Update
│ │ │ ├── nz3gs05w.exe
│ │ │ ├── nz3gs05w.txt
│ │ │ ├── nz3gs05w_2_.xml
│ │ │ ├── nz3gs05w_2_Empty_Corrupt.xml
│ │ │ └── nz3gs05w_2_Missing_Installer_Element.xml
│ ├── LenovoSccm
│ │ ├── ds112090.html
│ │ ├── ds112090_Invalid_Document.html
│ │ ├── ds112090_MissingDownloadsTab.html
│ │ ├── ds112090_Missing_Downloads_Links.html
│ │ ├── ds112090_new_2019-12-01.html
│ │ ├── ds540208.html
│ │ └── ds540208_v2.html
│ └── TestDataXmlHelper.xml
│ ├── UiModelsTests.fs
│ ├── WebParsingTests.fs
│ ├── WebTests.fs
│ ├── WmiHelperTests.fs
│ ├── XmlHelperTests.fs
│ ├── XmlToolKitTests.fs
│ └── _TemplateTests.fs
└── tools
├── Nuget
└── NuGet.exe
└── XmlDoc2CmdletDoc
├── FSharp.Core.dll
├── Jolt.dll
├── Microsoft.ApplicationInsights.dll
├── Microsoft.Win32.Registry.AccessControl.dll
├── Microsoft.Win32.SystemEvents.dll
├── Newtonsoft.Json.dll
├── System.CodeDom.dll
├── System.Configuration.ConfigurationManager.dll
├── System.Diagnostics.EventLog.dll
├── System.DirectoryServices.dll
├── System.Drawing.Common.dll
├── System.Management.dll
├── System.Security.Cryptography.Pkcs.dll
├── System.Security.Cryptography.ProtectedData.dll
├── System.Security.Permissions.dll
├── System.Windows.Extensions.dll
├── XmlDoc2CmdletDoc.Core.dll
├── XmlDoc2CmdletDoc.Core.pdb
├── XmlDoc2CmdletDoc.Core.xml
├── XmlDoc2CmdletDoc.deps.json
├── XmlDoc2CmdletDoc.dll
├── XmlDoc2CmdletDoc.dll.config
├── XmlDoc2CmdletDoc.exe
├── XmlDoc2CmdletDoc.runtimeconfig.dev.json
├── XmlDoc2CmdletDoc.runtimeconfig.json
├── ref
└── XmlDoc2CmdletDoc.dll
└── runtimes
├── linux-arm
└── native
│ └── libpsl-native.so
├── linux-arm64
└── native
│ └── libpsl-native.so
├── linux-musl-x64
└── native
│ └── libpsl-native.so
├── linux-x64
└── native
│ ├── libmi.so
│ ├── libpsl-native.so
│ └── libpsrpclient.so
├── osx
└── native
│ ├── libmi.dylib
│ ├── libpsl-native.dylib
│ └── libpsrpclient.dylib
├── unix
└── lib
│ ├── net5.0
│ └── System.Management.Automation.dll
│ ├── netcoreapp3.0
│ └── System.Drawing.Common.dll
│ └── netstandard1.6
│ └── Microsoft.Management.Infrastructure.dll
├── win-arm
├── lib
│ └── netstandard1.6
│ │ ├── Microsoft.Management.Infrastructure.Native.dll
│ │ └── Microsoft.Management.Infrastructure.dll
└── native
│ ├── Microsoft.Management.Infrastructure.Native.Unmanaged.dll
│ ├── PowerShell.Core.Instrumentation.dll
│ ├── mi.dll
│ ├── miutils.dll
│ └── pwrshplugin.dll
├── win-arm64
├── lib
│ └── netstandard1.6
│ │ ├── Microsoft.Management.Infrastructure.Native.dll
│ │ └── Microsoft.Management.Infrastructure.dll
└── native
│ ├── Microsoft.Management.Infrastructure.Native.Unmanaged.dll
│ ├── PowerShell.Core.Instrumentation.dll
│ ├── mi.dll
│ ├── miutils.dll
│ └── pwrshplugin.dll
├── win-x64
└── native
│ ├── PowerShell.Core.Instrumentation.dll
│ └── pwrshplugin.dll
├── win-x86
└── native
│ ├── PowerShell.Core.Instrumentation.dll
│ └── pwrshplugin.dll
├── win
└── lib
│ ├── net5.0
│ ├── Microsoft.PowerShell.CoreCLR.Eventing.dll
│ └── System.Management.Automation.dll
│ ├── netcoreapp2.0
│ ├── System.Diagnostics.EventLog.Messages.dll
│ ├── System.Diagnostics.EventLog.dll
│ ├── System.DirectoryServices.dll
│ └── System.Management.dll
│ ├── netcoreapp3.0
│ ├── Microsoft.Win32.SystemEvents.dll
│ ├── System.Drawing.Common.dll
│ ├── System.Security.Cryptography.Pkcs.dll
│ └── System.Windows.Extensions.dll
│ └── netstandard2.0
│ ├── Microsoft.Win32.Registry.AccessControl.dll
│ └── System.Security.Cryptography.ProtectedData.dll
├── win10-x64
├── lib
│ └── netstandard1.6
│ │ ├── Microsoft.Management.Infrastructure.Native.dll
│ │ └── Microsoft.Management.Infrastructure.dll
└── native
│ ├── Microsoft.Management.Infrastructure.Native.Unmanaged.dll
│ ├── mi.dll
│ └── miutils.dll
├── win10-x86
├── lib
│ └── netstandard1.6
│ │ ├── Microsoft.Management.Infrastructure.Native.dll
│ │ └── Microsoft.Management.Infrastructure.dll
└── native
│ ├── Microsoft.Management.Infrastructure.Native.Unmanaged.dll
│ ├── mi.dll
│ └── miutils.dll
├── win7-x64
├── lib
│ └── netstandard1.6
│ │ ├── Microsoft.Management.Infrastructure.Native.dll
│ │ └── Microsoft.Management.Infrastructure.dll
└── native
│ ├── Microsoft.Management.Infrastructure.Native.Unmanaged.dll
│ ├── mi.dll
│ └── miutils.dll
├── win7-x86
├── lib
│ └── netstandard1.6
│ │ ├── Microsoft.Management.Infrastructure.Native.dll
│ │ └── Microsoft.Management.Infrastructure.dll
└── native
│ ├── Microsoft.Management.Infrastructure.Native.Unmanaged.dll
│ ├── mi.dll
│ └── miutils.dll
├── win8-x64
├── lib
│ └── netstandard1.6
│ │ ├── Microsoft.Management.Infrastructure.Native.dll
│ │ └── Microsoft.Management.Infrastructure.dll
└── native
│ ├── mi.dll
│ └── miutils.dll
├── win8-x86
├── lib
│ └── netstandard1.6
│ │ ├── Microsoft.Management.Infrastructure.Native.dll
│ │ └── Microsoft.Management.Infrastructure.dll
└── native
│ ├── mi.dll
│ └── miutils.dll
├── win81-x64
├── lib
│ └── netstandard1.6
│ │ ├── Microsoft.Management.Infrastructure.Native.dll
│ │ └── Microsoft.Management.Infrastructure.dll
└── native
│ ├── Microsoft.Management.Infrastructure.Native.Unmanaged.dll
│ ├── mi.dll
│ └── miutils.dll
└── win81-x86
├── lib
└── netstandard1.6
│ ├── Microsoft.Management.Infrastructure.Native.dll
│ └── Microsoft.Management.Infrastructure.dll
└── native
├── Microsoft.Management.Infrastructure.Native.Unmanaged.dll
├── mi.dll
└── miutils.dll
/.gitignore:
--------------------------------------------------------------------------------
1 | #Ignore build directories
2 | bin/*
3 | obj/*
4 | bld/*
5 | [Bb]in/
6 | obj*/
7 | [Dd]ebug*/
8 | [Rr]elease*/
9 |
10 | # Ignore Visual Studio files
11 | *.obj
12 | *.user
13 | *.aps
14 | *.pch
15 | *.vspscc
16 | *_i.c
17 | *_p.c
18 | *.ncb
19 | *.suo
20 | *.tlh
21 | *.bak
22 | *.cache
23 | *.ilk
24 | *.log
25 | *.lib
26 | *.sbr
27 | *.scc
28 |
29 | #Include binaries (build tools etc.)
30 | !*.exe
31 | !*.pdb
32 | !*.msi
33 | !*.tlb
34 | !*.dll
35 |
36 | #Other
37 | .fake/*
38 | .vs/*
39 | build/
40 | artifact/
41 | packages/
42 | _NCrunch_DriverTool/*
43 | build.fsx.lock
44 | [Tt]est[Rr]esult*
45 | [Bb]uild[Ll]og.*
46 | .ionide
47 | .fake
48 | artifacts/
49 |
50 | nChrunchTemp*
51 |
52 | modules/DriverTool.PowerCLI/binary/
53 | .idea/
54 |
--------------------------------------------------------------------------------
/.nuget/NuGet.Config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/Build.ps1:
--------------------------------------------------------------------------------
1 | <# Build Powershell Module #>
2 | param(
3 | [Parameter(Mandatory=$false,ValueFromRemainingArguments=$true)]
4 | [ValidateSet("Default","UpdateVersion")]
5 | [string]
6 | $BuildTarget="Default",
7 | [Parameter(Mandatory=$false)]
8 | [int]
9 | $AddDaysToBuildVersion = 0
10 | )
11 | if($BuildTarget -eq "Default")
12 | {
13 | Invoke-psake -taskList $BuildTarget
14 | }
15 | elseif($BuildTarget -eq "UpdateVersion") {
16 | Invoke-psake -taskList $BuildTarget -parameters @{ 'AddDaysToBuildVersion'=$AddDaysToBuildVersion; }
17 | }
18 | else {
19 | Invoke-psake -taskList $BuildTarget
20 | }
21 |
22 |
23 |
--------------------------------------------------------------------------------
/DriverTool.v3.ncrunchsolution:
--------------------------------------------------------------------------------
1 |
2 |
3 | True
4 | True
5 |
6 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | BSD 3-Clause License
2 |
3 | Copyright (c) 2018-2023 github/trondr
4 |
5 | All rights reserved.
6 |
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions are met:
9 |
10 | 1. Redistributions of source code must retain the above copyright notice, this
11 | list of conditions and the following disclaimer.
12 |
13 | 2. Redistributions in binary form must reproduce the above copyright notice,
14 | this list of conditions and the following disclaimer in the documentation
15 | and/or other materials provided with the distribution.
16 |
17 | 3. Neither the name of the copyright holder nor the names of its
18 | contributors may be used to endorse or promote products derived from
19 | this software without specific prior written permission.
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 |
--------------------------------------------------------------------------------
/Notes.txt:
--------------------------------------------------------------------------------
1 | HP Issue 1
2 | ----------
3 | There is an issue with an currently unknown HP driver or software creating and installing files into folder: C:\Windows\sysnative
4 | MSVCP140.dll
5 | VCRUNTIME140.dll
6 | These files should probably have been installed into C:\Windows\System32.
7 | The fact that C:\Windows\sysnative exists for a 64 bit process this might trip an cmd installations checking for this folder in the following manner: "If sysnative folder exists then assume 32 bit process and set "C:\Windows\sysnative" as location of the 64 bits cmd.exe to launch 64 bits process cmd." This logic will only work if c:\Windows\sysnative does not exists for 64 bit processes, which is usually correct.
8 | This needs to be investigated further.
9 |
10 |
11 | HP Issue 2
12 | ----------
13 | After installing the HP updates using command lines as specified in WSUS updates ftp://ftp.hp.com/pub/softlib/software/sms_catalog/HpCatalogForSms.latest.cab
14 | the updates leave a folder with all the installation files C:\SWSetup. Approx 5 GB of data. No cleanup is done.
15 |
16 |
17 |
18 | Dell Update Catalog
19 | -------------------
20 | ftp://ftp.dell.com/catalog/DellSDPCatalogPC.cab
21 |
22 |
23 |
24 | Lenovo Update Catalog
25 | ----------------------
26 | https://download.lenovo.com/luc/v2/LenovoUpdatesCatalog2v2.cab
27 |
28 |
29 | Generate dll embedded resource statements for DriverTool.exe.
30 | -------------------------------------------------------------
31 | Get-ChildItem -Filter *.dll | Select-Object Name | Foreach-Object { "" }
32 |
33 |
34 |
35 |
--------------------------------------------------------------------------------
/PSMDConfig.ps1:
--------------------------------------------------------------------------------
1 | $PSMDConfig = @{
2 | "GitHubUrl"="https://github.com/trondr/DriverTool"
3 | "PsCmdLetPrefix"="Dt"
4 | }
--------------------------------------------------------------------------------
/doc/Dell MUP Command Line Options.txt:
--------------------------------------------------------------------------------
1 | ===== MUP Command Line Options =====
2 |
3 | /? :
4 | Display command line usage help.
5 | Syntax. packagename.exe /?
6 | /s :
7 | Execute the update package silently without user intervention.
8 | Syntax. packagename.exe /s
9 | /extract_all :
10 | Extract all of the contents of the MUP package.
11 | Syntax. packagename.exe /extract_all:
12 | /v :
13 | Public properties option.
14 |
15 | ===== MUP Public properties options =====
16 |
17 | /FORCE=true :
18 | Force a downgrade to an older version.
19 | Syntax. packagename.exe /s /v"FORCE=true"
20 | /EXTRACTDRIVERS= :
21 | Extract raw system level driver files.
22 | Syntax. packagename.exe /s /v"EXTRACTDRIVERS="
23 | /FORCERESTART=true :
24 | Reboot the system if necessary after the update.
25 | Syntax. packagename.exe /s /v"FORCERESTART=true"
26 | /LOGFILE= :
27 | Append installation log to a specified log file.
28 | Syntax. packagename.exe /s /v"LOGFILE="
--------------------------------------------------------------------------------
/doc/HP EliteBook 830 G5 - Support.url:
--------------------------------------------------------------------------------
1 | [{000214A0-0000-0000-C000-000000000046}]
2 | Prop3=19,11
3 | [InternetShortcut]
4 | IDList=
5 | URL=https://support.hp.com/us-en/drivers/selfservice/hp-elitebook-830-g5-notebook-pc/18477184/model/18477185?sku=2FZ82AV
6 |
--------------------------------------------------------------------------------
/doc/HP EliteBook 830 G5 Base Model bærbar PC - Drivernedlastinger - HP® Brukerstøtte.url:
--------------------------------------------------------------------------------
1 | [InternetShortcut]
2 | URL=https://support.hp.com/no-no/drivers/selfservice/hp-elitebook-830-g5-notebook-pc/18477184/model/18477185?sku=2FZ82AV
3 |
--------------------------------------------------------------------------------
/doc/images/DriverPackage_Drivers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/doc/images/DriverPackage_Drivers.png
--------------------------------------------------------------------------------
/doc/images/DriverPackage_Root.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/doc/images/DriverPackage_Root.png
--------------------------------------------------------------------------------
/doc/images/InitialDriverPackage_CommandLine.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/doc/images/InitialDriverPackage_CommandLine.png
--------------------------------------------------------------------------------
/doc/images/InitialDriverPackage_Create.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/doc/images/InitialDriverPackage_Create.png
--------------------------------------------------------------------------------
/doc/images/InitialDriverPackage_Drivers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/doc/images/InitialDriverPackage_Drivers.png
--------------------------------------------------------------------------------
/doc/images/InitialDriverPackage_Root.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/doc/images/InitialDriverPackage_Root.png
--------------------------------------------------------------------------------
/doc/images/TaskSeqence-CM-Device-Drivers-Wmi-Query.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/doc/images/TaskSeqence-CM-Device-Drivers-Wmi-Query.png
--------------------------------------------------------------------------------
/doc/images/TaskSeqence-CM-Device-Drivers.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/doc/images/TaskSeqence-CM-Device-Drivers.png
--------------------------------------------------------------------------------
/doc/images/TaskSeqence-Device-Driver-Updates-1.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/doc/images/TaskSeqence-Device-Driver-Updates-1.png
--------------------------------------------------------------------------------
/doc/images/TaskSeqence-Device-Driver-Updates-2.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/doc/images/TaskSeqence-Device-Driver-Updates-2.png
--------------------------------------------------------------------------------
/doc/images/TaskSeqence-Device-Driver-Updates-Restart.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/doc/images/TaskSeqence-Device-Driver-Updates-Restart.png
--------------------------------------------------------------------------------
/doc/images/TaskSeqence-Device-Driver-Updates-Wmi-Query.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/doc/images/TaskSeqence-Device-Driver-Updates-Wmi-Query.png
--------------------------------------------------------------------------------
/example_data/Dell_CatalogPC.xml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/example_data/Dell_CatalogPC.xml
--------------------------------------------------------------------------------
/example_data/HP_actionLog.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Conexant HD Audio Driver 2017/2018
5 | 91fe8a2f-f09f-44b9-b93d-d6a5ce2637cb
6 | sp92797
7 | 1
8 |
9 |
10 | HP Firmware Pack (Q78)
11 | 955752f0-0da8-4b39-b597-61e786bd8131
12 | sp94780
13 | 0
14 |
15 |
16 | HP Universal Camera Driver 2017/2018
17 | 72f0008a-a8c6-45bd-a47b-009ef33002c1
18 | sp90115
19 | 0
20 |
21 |
22 | Intel Bluetooth Driver
23 | 584607f6-3da3-4747-9c79-60ad16c5a1db
24 | sp93050
25 | 0
26 |
27 |
28 | Intel Chipset Installation Utility
29 | 31efc543-8406-4569-a0ca-631a263c906b
30 | sp84426
31 | 0
32 |
33 |
34 | Intel Management Engine Driver
35 | b21fba77-11cb-43b9-8248-b534cd81f47d
36 | sp88934
37 | 0
38 |
39 |
40 | Intel WLAN Driver for Microsoft Windows 10
41 | 0a10a774-b4b7-4396-b6ce-284b85e0cb09
42 | sp88888
43 | 0
44 |
45 |
46 | Synaptics VFS7552 WBF Touch Fingerprint Driver
47 | 515021d7-4bf9-4c48-95dd-215c127589be
48 | sp93499
49 | 0
50 |
51 |
--------------------------------------------------------------------------------
/example_data/TestWindowsUpdateServicesApi/TestWindowsUpdateServicesApi.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | VisualStudioVersion = 15.0.28307.421
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{F2A71F9B-5D33-465A-A702-920D77279786}") = "TestWindowsUpdateServicesApi", "TestWindowsUpdateServicesApi\TestWindowsUpdateServicesApi.fsproj", "{CEF5CA16-305C-4ADD-939D-57C02970409A}"
7 | EndProject
8 | Global
9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
10 | Debug|Any CPU = Debug|Any CPU
11 | Release|Any CPU = Release|Any CPU
12 | EndGlobalSection
13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
14 | {CEF5CA16-305C-4ADD-939D-57C02970409A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
15 | {CEF5CA16-305C-4ADD-939D-57C02970409A}.Debug|Any CPU.Build.0 = Debug|Any CPU
16 | {CEF5CA16-305C-4ADD-939D-57C02970409A}.Release|Any CPU.ActiveCfg = Release|Any CPU
17 | {CEF5CA16-305C-4ADD-939D-57C02970409A}.Release|Any CPU.Build.0 = Release|Any CPU
18 | EndGlobalSection
19 | GlobalSection(SolutionProperties) = preSolution
20 | HideSolutionNode = FALSE
21 | EndGlobalSection
22 | GlobalSection(ExtensibilityGlobals) = postSolution
23 | SolutionGuid = {516C13A2-8ECC-4314-A00A-DD7CA9B7810B}
24 | EndGlobalSection
25 | EndGlobal
26 |
--------------------------------------------------------------------------------
/example_data/TestWindowsUpdateServicesApi/TestWindowsUpdateServicesApi/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/example_data/TestWindowsUpdateServicesApi/TestWindowsUpdateServicesApi/AssemblyInfo.fs:
--------------------------------------------------------------------------------
1 | namespace TestWindowsUpdateServicesApi.AssemblyInfo
2 |
3 | open System.Reflection
4 | open System.Runtime.CompilerServices
5 | open System.Runtime.InteropServices
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | []
11 | []
12 | []
13 | []
14 | []
15 | []
16 | []
17 | []
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | []
23 |
24 | // The following GUID is for the ID of the typelib if this project is exposed to COM
25 | []
26 |
27 | // Version information for an assembly consists of the following four values:
28 | //
29 | // Major Version
30 | // Minor Version
31 | // Build Number
32 | // Revision
33 | //
34 | // You can specify all the values or you can default the Build and Revision Numbers
35 | // by using the '*' as shown below:
36 | // []
37 | []
38 | []
39 |
40 | do
41 | ()
--------------------------------------------------------------------------------
/example_data/TestWindowsUpdateServicesApi/TestWindowsUpdateServicesApi/Program.fs:
--------------------------------------------------------------------------------
1 | // Learn more about F# at http://fsharp.org
2 | // See the 'F# Tutorial' project for more help.
3 |
4 | open Microsoft.UpdateServices.Administration
5 |
6 | []
7 | let main argv =
8 |
9 | let updateFileName = @"C:\Temp\DriverToolCache\HpCatalogForSms.latest\V2\00004850-0000-0000-5350-000000092797.sdp"
10 |
11 | let loadSoftwarePackage (fileName:string) =
12 | let softwareDistributionPackage = new SoftwareDistributionPackage(fileName)
13 | printfn "Description: %s" softwareDistributionPackage.Description
14 | printfn "Installed?: %s" softwareDistributionPackage.IsInstallable
15 |
16 | loadSoftwarePackage updateFileName
17 |
18 | printfn "%A" argv
19 | 0 // return an integer exit code
20 |
--------------------------------------------------------------------------------
/example_data/TestWindowsUpdateServicesApi/TestWindowsUpdateServicesApi/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/modules/DriverTool.PowerCLI/DriverTool.PowerCLI.Format.ps1xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/modules/DriverTool.PowerCLI/LICENSE:
--------------------------------------------------------------------------------
1 | BSD 3-Clause License
2 |
3 | Copyright (c) 2018-2023, github/trondr
4 |
5 | All rights reserved.
6 |
7 | Redistribution and use in source and binary forms, with or without
8 | modification, are permitted provided that the following conditions are met:
9 |
10 | 1. Redistributions of source code must retain the above copyright notice, this
11 | list of conditions and the following disclaimer.
12 |
13 | 2. Redistributions in binary form must reproduce the above copyright notice,
14 | this list of conditions and the following disclaimer in the documentation
15 | and/or other materials provided with the distribution.
16 |
17 | 3. Neither the name of the copyright holder nor the names of its
18 | contributors may be used to endorse or promote products derived from
19 | this software without specific prior written permission.
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 |
--------------------------------------------------------------------------------
/modules/DriverTool.PowerCLI/README.md:
--------------------------------------------------------------------------------
1 | # DriverTool.PowerCLI
2 |
3 | Download drivers and updates for Dell, HP and Lenovo PC models. Package drivers and updates for import into SCCM as a package or Application.
--------------------------------------------------------------------------------
/modules/DriverTool.PowerCLI/internal/functions/Assert-DtCmClientIsInstalled.ps1:
--------------------------------------------------------------------------------
1 | function Assert-DtCmClientIsInstalled
2 | {
3 | <#
4 | .SYNOPSIS
5 | Assert that Sccm Client is installed
6 |
7 | .DESCRIPTION
8 | Assert that Sccm Client is installed
9 |
10 | .EXAMPLE
11 | Assert-DtCmClientIsInstalled
12 |
13 | .NOTES
14 | Version: 1.0
15 | Author: github.com/trondr
16 | Company: github.com/trondr
17 | Repository: https://github.com/trondr/DriverTool.git
18 | #>
19 | [CmdletBinding()]
20 | Param (
21 | [Parameter(ValueFromPipeline=$true)]
22 | $InputObject
23 | )
24 |
25 | begin
26 | {
27 |
28 | }
29 | process
30 | {
31 | try {
32 | $((New-Object -ComObject "Microsoft.SMS.Client").GetAssignedSite()) | Out-Null
33 | }
34 | catch {
35 | throw "SCCM Client is not installed. Please install SCCM client and try again."
36 | }
37 | }
38 | end
39 | {
40 |
41 | }
42 | }
43 | #TEST:
44 | #Assert-DtCmClientIsInstalled
--------------------------------------------------------------------------------
/modules/DriverTool.PowerCLI/internal/functions/Assert-DtCmManagerConsoleIsInstalled.ps1:
--------------------------------------------------------------------------------
1 | function Assert-DtCmManagerConsoleIsInstalled
2 | {
3 | <#
4 | .SYNOPSIS
5 | Assert that Sccm Manager Console is installed.
6 |
7 | .DESCRIPTION
8 | Assert that Sccm Manager Console is installed.
9 |
10 | .EXAMPLE
11 | Assert-DtCmManagerConsoleIsInstalled
12 |
13 | .NOTES
14 | Version: 1.0
15 | Author: github.com/trondr
16 | Company: github.com/trondr
17 | Repository: https://github.com/trondr/DriverTool.git
18 | #>
19 | [CmdletBinding()]
20 | Param (
21 | [Parameter(ValueFromPipeline=$true)]
22 | $InputObject
23 | )
24 |
25 | begin
26 | {
27 |
28 | }
29 | process
30 | {
31 | if((Test-Path -Path "$($ENV:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1") -eq $false)
32 | {
33 | throw "SCCM Manager Console is not installed. Please install SCCM Manager Console and try again."
34 | }
35 | }
36 | end
37 | {
38 |
39 | }
40 | }
41 | #TEST:
42 | #Assert-DtCmManagerConsoleIsInstalled
--------------------------------------------------------------------------------
/modules/DriverTool.PowerCLI/internal/functions/Assert-DtFileExists.ps1:
--------------------------------------------------------------------------------
1 | function Assert-DtFileExists
2 | {
3 | <#
4 | .SYNOPSIS
5 | Assert that file exists.
6 |
7 | .DESCRIPTION
8 | Assert that file exists.
9 |
10 | .EXAMPLE
11 | Assert-DtFileExists -Path "c:\temp\somefile.txt" -Message "Can not continue with the important stuff due to some file not found."
12 |
13 | .NOTES
14 | Version: 1.0
15 | Author: github/trondr
16 | Company: github/trondr
17 | Repository: https://github.com/trondr/DriverTool.git
18 | #>
19 | [CmdletBinding()]
20 | param (
21 | [Parameter(Mandatory=$true)]
22 | [string]
23 | $Path,
24 | [Parameter(Mandatory=$true)]
25 | [string]
26 | $Message
27 | )
28 |
29 | begin {
30 |
31 | }
32 |
33 | process {
34 | if(Test-Path -Path $Path)
35 | {
36 | Write-Verbose "File exists: $Path"
37 | }
38 | else {
39 | throw "File does not exist: '$Path'. $Message"
40 | }
41 | }
42 |
43 | end {
44 |
45 | }
46 | }
--------------------------------------------------------------------------------
/modules/DriverTool.PowerCLI/internal/functions/Get-DtCmAssignedSite.ps1:
--------------------------------------------------------------------------------
1 | function Get-DtCmAssignedSite
2 | {
3 | <#
4 | .SYNOPSIS
5 | Get Sccm assigned site
6 |
7 | .DESCRIPTION
8 | Get Sccm assigned site
9 |
10 | .EXAMPLE
11 | Get-DtCmAssignedSite
12 |
13 | .NOTES
14 | Version: 1.0
15 | Author: trondr
16 | Company: MyCompany
17 | Repository: https://github.com/trondr/DriverTool.git
18 | #>
19 | [CmdletBinding()]
20 | Param (
21 | [Parameter(ValueFromPipeline=$true)]
22 | $InputObject
23 | )
24 |
25 | begin
26 | {
27 | Assert-DtCmClientIsInstalled
28 | }
29 | process
30 | {
31 | $((New-Object -ComObject "Microsoft.SMS.Client").GetAssignedSite())
32 | }
33 | end
34 | {
35 |
36 | }
37 | }
--------------------------------------------------------------------------------
/modules/DriverTool.PowerCLI/internal/functions/Get-DtCmCurrentManagementPoint.ps1:
--------------------------------------------------------------------------------
1 | function Get-DtCmCurrentManagementPoint
2 | {
3 | <#
4 | .SYNOPSIS
5 | Get current Sccm management point
6 |
7 | .DESCRIPTION
8 | Get current Sccm management point
9 |
10 | .EXAMPLE
11 | Get-DtCmCurrentManagementPoint
12 |
13 | .NOTES
14 | Version: 1.0
15 | Author: trondr
16 | Company: MyCompany
17 | Repository: https://github.com/trondr/DriverTool.git
18 | #>
19 | [CmdletBinding()]
20 | Param (
21 | [Parameter(ValueFromPipeline=$true)]
22 | $InputObject
23 | )
24 |
25 | begin
26 | {
27 | Assert-DtCmClientIsInstalled
28 | }
29 | process
30 | {
31 | (New-Object -ComObject "Microsoft.SMS.Client").GetCurrentManagementPoint()
32 | }
33 | end
34 | {
35 |
36 | }
37 | }
--------------------------------------------------------------------------------
/modules/DriverTool.PowerCLI/internal/functions/readme.md:
--------------------------------------------------------------------------------
1 | # Functions
2 |
3 | This is the folder where the internal functions go.
4 |
5 | Depending on the complexity of the module, it is recommended to subdivide them into subfolders.
6 |
7 | The module will pick up all .ps1 files recursively
--------------------------------------------------------------------------------
/modules/DriverTool.PowerCLI/internal/scripts/postimport.ps1:
--------------------------------------------------------------------------------
1 | # Place all code that should be run after functions are imported here
2 | $global:DriverToolExe = [System.IO.Path]::Combine($global:ModuleRootPath,"binary","DriverTool.PowerCLI.Library.FSharp","DriverTool.exe")
3 | Assert-DtFileExists -Path $DriverToolExe -Message "DriverTool.exe ($driverToolExe) not found."
--------------------------------------------------------------------------------
/modules/DriverTool.PowerCLI/internal/scripts/preimport.ps1:
--------------------------------------------------------------------------------
1 | # Place all code that should be run before functions are imported here
--------------------------------------------------------------------------------
/modules/DriverTool.PowerCLI/internal/scripts/readme.md:
--------------------------------------------------------------------------------
1 | # Scripts
2 |
3 | This is the folder where the internal scripts go.
4 |
5 | These are files that are only run during import and can be used to add content other than just functions.
6 |
7 | For example you could use these to connect to a service, load configuration data or define tab completion.
8 |
--------------------------------------------------------------------------------
/modules/DriverTool.PowerCLI/internal/tools/readme.md:
--------------------------------------------------------------------------------
1 | # Tools
2 |
3 | This is the folder where tool go.
4 |
5 | Tools are executeables that the module depends on.
--------------------------------------------------------------------------------
/modules/DriverTool.PowerCLI/public/classes/readme.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/modules/DriverTool.PowerCLI/public/functions/Connect-DtCmSite.ps1:
--------------------------------------------------------------------------------
1 | function Connect-DtCmSite
2 | {
3 | <#
4 | .SYNOPSIS
5 | Connect to Sccm site
6 |
7 | .DESCRIPTION
8 | Connect to Sccm site. It is required that System Configuration Manager Console is installed.
9 |
10 | .EXAMPLE
11 | Connect-DtCmSite
12 |
13 | .NOTES
14 | Version: 1.0
15 | Author: github/trondr
16 | Company: github/trondr
17 | Repository: https://github.com/trondr/DriverTool.git
18 | #>
19 | [CmdletBinding()]
20 | Param (
21 | [Parameter(Mandatory=$false)]
22 | [string]
23 | $SiteCode=$(Get-DtCmAssignedSite),
24 | [Parameter(Mandatory=$false)]
25 | [string]
26 | $SiteServer=$(Get-DtCmCurrentManagementPoint)
27 | )
28 |
29 | begin
30 | {
31 | Assert-DtCmManagerConsoleIsInstalled
32 | # Customizations
33 | $initParams = @{}
34 | #$initParams.Add("Verbose", $true) # Uncomment this line to enable verbose logging
35 | $initParams.Add("ErrorAction", "Stop") # Uncomment this line to stop the script on any errors
36 | }
37 | process
38 | {
39 | if($null -eq (Get-Module ConfigurationManager)) {
40 | Import-Module "$($ENV:SMS_ADMIN_UI_PATH)\..\ConfigurationManager.psd1" @initParams
41 | }
42 |
43 | if($null -eq (Get-PSDrive -Name $SiteCode -PSProvider CMSite -ErrorAction SilentlyContinue)) {
44 | New-PSDrive -Name $SiteCode -PSProvider CMSite -Root $SiteServer @initParams
45 | }
46 |
47 | # Set the current location to be the site code.
48 | Set-Location "$($SiteCode):\" @initParams
49 | }
50 | end
51 | {
52 |
53 | }
54 | }
--------------------------------------------------------------------------------
/modules/DriverTool.PowerCLI/public/functions/Get-DtCmDeviceModel.ps1:
--------------------------------------------------------------------------------
1 | function Get-DtCmDeviceModel
2 | {
3 | <#
4 | .SYNOPSIS
5 | Get device models from SCCM
6 |
7 | .DESCRIPTION
8 | Get device models from SCCM
9 |
10 | .EXAMPLE
11 | Get-DtCmDeviceModel
12 |
13 | .NOTES
14 | Version: 1.0
15 | Author: github/trondr
16 | Company: github/trondr
17 | Repository: https://github.com/trondr/DriverTool.git
18 | #>
19 | [CmdletBinding()]
20 | Param (
21 | [Parameter(ValueFromPipeline=$true)]
22 | $InputObject
23 | )
24 |
25 | begin
26 | {
27 |
28 | Connect-DtCmSite
29 | $Query = @'
30 | select distinct
31 | SMS_G_System_COMPUTER_SYSTEM.Model,
32 | SMS_G_System_COMPUTER_SYSTEM.Manufacturer,
33 | SMS_G_System_COMPUTER_SYSTEM_PRODUCT.Version
34 | from SMS_R_System
35 | inner join SMS_G_System_COMPUTER_SYSTEM on SMS_G_System_COMPUTER_SYSTEM.ResourceID = SMS_R_System.ResourceId
36 | inner join SMS_G_System_COMPUTER_SYSTEM_PRODUCT on SMS_G_System_COMPUTER_SYSTEM_PRODUCT.ResourceID = SMS_R_System.ResourceId
37 | where SMS_G_System_COMPUTER_SYSTEM.Manufacturer = 'LENOVO'
38 | '@
39 | Write-Host "Only LENOVO currently supported by the Get-DtCmDeviceModel CmdLet" -ForegroundColor Yellow
40 | Write-Host "TODO: Add support for Dell" -ForegroundColor Yellow
41 | Write-Host "TODO: Add support for HP" -ForegroundColor Yellow
42 | }
43 | process
44 | {
45 | Invoke-CMWmiQuery -Query $Query | Foreach-Object {
46 | [pscustomobject][ordered]@{
47 | Manufacturer = $_.SMS_G_System_COMPUTER_SYSTEM.Manufacturer
48 | ModelCodeFull = $_.SMS_G_System_COMPUTER_SYSTEM.Model
49 | ModelCode = $($_.SMS_G_System_COMPUTER_SYSTEM.Model).SubString(0,4)
50 | ModelName = $_.SMS_G_System_COMPUTER_SYSTEM_PRODUCT.Version
51 | }
52 | }|Select-Object Manufacturer,ModelCode,ModelName
53 | }
54 | end
55 | {
56 |
57 | }
58 | }
59 | #TEST:Get-DtCmDeviceModel
--------------------------------------------------------------------------------
/modules/DriverTool.PowerCLI/public/functions/New-DtCmPackageFromDriverPackPackageDefinition.ps1:
--------------------------------------------------------------------------------
1 | function New-DtCmPackageFromDriverPackPackageDefinitionSms
2 | {
3 | <#
4 | .SYNOPSIS
5 | Create new Sccm package from driver pack package definition.
6 |
7 | .DESCRIPTION
8 | Create new Sccm package from driver pack package definition.
9 |
10 | .EXAMPLE
11 | $packageDefintionSms = Get-ChildItem -Path "Z:\Packages\CM-Drivers\21H2" -Filter "PackageDefinition.sms" -Recurse | ForEach-Object {$_.FullName}
12 | $packageDefintionSms | New-DtCmPackageFromDriverPackPackageDefinitionSms
13 |
14 | .NOTES
15 | Version: 1.0
16 | Author: github/trondr
17 | Company: github/trondr
18 | Repository: https://github.com/trondr/DriverTool.git
19 | #>
20 | [CmdletBinding()]
21 | Param (
22 | [Parameter(ValueFromPipeline=$true)]
23 | #Path to package definition sms file
24 | [System.string[]]
25 | $Path
26 | )
27 |
28 | begin
29 | {
30 | Connect-DtCmSite
31 | Write-Host "Connected"
32 | }
33 | process
34 | {
35 | foreach($p in $Path)
36 | {
37 | try {
38 | $script = Get-DtScriptNewCmPackageFromDriverPackPackageDefinitionSms -Path $p
39 | Write-Host "Invoking script to create Sccm Package:"
40 | Write-Host "$script"
41 | Write-Host "--------------------------------------------------------------------------------"
42 | Invoke-Expression $script
43 | Write-Host "--------------------------------------------------------------------------------"
44 | }
45 | catch {
46 | Write-Host "New-DtCmPackageFromDriverPackPackageDefinitionSms failed processing '$($p)' due to: $(Convert-DtExceptionToMessage -Exception $_.Exception)" -ForegroundColor Red
47 | }
48 | }
49 | }
50 | end
51 | {
52 |
53 | }
54 | }
--------------------------------------------------------------------------------
/modules/DriverTool.PowerCLI/public/functions/New-DtCmTaskSequenceFromDriverPackPackageDefinitionSms.ps1:
--------------------------------------------------------------------------------
1 | function New-DtCmTaskSequenceFromDriverPackPackageDefinitionSms
2 | {
3 | <#
4 | .SYNOPSIS
5 | Create new task sequence from driver pack package defintion sms.
6 |
7 | .DESCRIPTION
8 | Create new task sequence from driver pack package defintion sms.
9 |
10 | .EXAMPLE
11 | Write-Host "Package all driver packages in a folder structure and create and add to task sequence."
12 | $packageDefintionSms = Get-ChildItem -Path "Z:\Applications\CM-Drivers\21H2" -Filter "PackageDefinition.sms" -Recurse | ForEach-Object {$_.FullName}
13 | $packageDefintionSms | New-DtCmPackageFromDriverPackPackageDefinitionSms
14 | New-DtCmTaskSequenceFromDriverPackPackageDefinitionSms -Path $packageDefintionSms -Name "Test CM Drivers 21H2" -Description "Test CM Drivers 21H2" -ProgramName "INSTALL-OFFLINE-OS"
15 |
16 | .NOTES
17 | Version: 1.0
18 | Author: github/trondr
19 | Company: github/trondr
20 | Repository: https://github.com/trondr/DriverTool.git
21 | #>
22 | [CmdletBinding()]
23 | Param (
24 | [Parameter(ValueFromPipeline=$false,Mandatory=$true)]
25 | #Path to package definition sms file
26 | [System.string[]]
27 | $Path,
28 | [Parameter(Mandatory=$true)]
29 | [ValidateLength(1,50)]
30 | #Task sequence name. Maximum 50 characters long.
31 | [string]
32 | $Name,
33 | [Parameter(Mandatory=$true)]
34 | #Task sequence description
35 | [string]
36 | $Description,
37 | [Parameter(Mandatory=$true)]
38 | #Program name. Must exist in all PackageDefinition.sms files.
39 | [string]
40 | $ProgramName
41 | )
42 |
43 | begin
44 | {
45 | Connect-DtCmSite
46 | }
47 | process
48 | {
49 | try {
50 | $script = Get-DtScriptNewCmTaskSequenceFromDriverPackPackageDefinitionSms -Path $Path -Name $Name -Description $Description -ProgramName $ProgramName
51 | Write-Host "Invoking script to create Sccm Task Sequence:"
52 | Write-Host "$script"
53 | Write-Host "--------------------------------------------------------------------------------"
54 | Invoke-Expression $script
55 | Write-Host "--------------------------------------------------------------------------------"
56 | }
57 | catch {
58 | Write-Host "New-DtCmTaskSequenceFromDriverPackPackageDefinitionSms failed processing '$($Path)' due to: $(Convert-DtExceptionToMessage -Exception $_.Exception)" -ForegroundColor Red -ErrorAction Stop
59 | }
60 | }
61 | end
62 | {
63 |
64 | }
65 | }
--------------------------------------------------------------------------------
/modules/DriverTool.PowerCLI/public/functions/readme.md:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/nuget.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
--------------------------------------------------------------------------------
/revision.txt:
--------------------------------------------------------------------------------
1 | 86
2 |
--------------------------------------------------------------------------------
/scripts/OsSku2IsServerMatch.ps1:
--------------------------------------------------------------------------------
1 | #Copied OS SKUs from table: https://docs.microsoft.com/en-us/windows/desktop/api/sysinfoapi/nf-sysinfoapi-getproductinfo
2 | #into the following format (using a Notepad++ macro):
3 | #Code;Value;Meaning
4 | #PRODUCT_BUSINESS;0x00000006;Business
5 | #PRODUCT_BUSINESS_N;0x00000010;Business N
6 | #PRODUCT_CLUSTER_SERVER;0x00000012;HPC Edition
7 | #[...]
8 | $osSkus = Import-Csv -Path "C:\Temp\DriverToolCache\OSSkus.csv" -Delimiter ';'|Sort-Object -Property Value
9 | $osSkusTransformed = @()
10 | foreach($osSku in $osSkus)
11 | {
12 | $value = [Convert]::ToInt64($osSku.Value,16)
13 | $name = $osSku.Meaning
14 | $isServer = "false"
15 | if($name -match "Server")
16 | {
17 | $isServer = "true"
18 | }
19 | $item = [PSCustomObject]@{
20 |
21 | Value = $value
22 | Name = $name
23 | IsServer = $isServer
24 | }
25 | $osSkusTransformed+=$item
26 | }
27 | $osSkusTransformed|Sort-Object -Property Value|ForEach-Object { Write-Output "|$($_.Value)u -> $($_.IsServer) //$($_.Name)"}
28 | $osSkusTransformed|Sort-Object -Property Value|ForEach-Object { Write-Output "[]"}
29 |
30 |
31 |
--------------------------------------------------------------------------------
/src/app/DriverTool.CSharpLib/DriverTool.CSharpLib.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Library
4 | net48
5 | 1.0.23237.86
6 | 1.0.23237.86
7 | 1.0.23237
8 | Copyright (c) 2018-2023 github/trondr
9 |
10 |
11 | Dummy
12 |
13 |
14 |
15 | tlbimp
16 | 1
17 | 1
18 | eab22ac0-30c1-11cf-a7eb-0000c05bae0b
19 | 0
20 | false
21 | true
22 |
23 |
24 |
25 |
26 |
27 |
--------------------------------------------------------------------------------
/src/app/DriverTool.DpInstExitCode2ExitCode/DpInstExitCode.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool
2 |
3 | module DpInstExitCode =
4 |
5 | type DpInstExiCodeInfo =
6 | {
7 | DpInstExitCode: uint
8 | InstalledCount: uint
9 | CouldNotBeInstalledCount : uint
10 | CopiedToDriverStoreCount : uint
11 | CouldNotBeInstalled : bool
12 | RebootNeeded: bool
13 | ExitCode: uint
14 | }
15 |
16 |
17 | let getInstalledCount (dpInstExitCode:uint) =
18 | (uint 0x000000FF) &&& dpInstExitCode
19 |
20 | let getCopiedToDriverStoreCount (dpInstExitCode:uint) =
21 | (uint 0x0000FF00) &&& dpInstExitCode >>> 8
22 |
23 | let getCouldNotBeInstalledCount (dpInstExitCode:uint) =
24 | (uint 0x0000FF00) &&& dpInstExitCode >>> 16
25 |
26 | let getRebootNeeded (dpInstExitCode:uint) =
27 | (dpInstExitCode &&& (uint 0x40000000)) > 0u
28 |
29 | let getCouldNotBeInstalled (dpInstExitCode:uint) =
30 | (dpInstExitCode &&& (uint 0x80000000)) > 0u
31 |
32 | let toDpInstExitCodeInfo dpInstExitCode =
33 | {
34 | DpInstExitCode = dpInstExitCode
35 | InstalledCount = getInstalledCount dpInstExitCode
36 | CouldNotBeInstalledCount = getCouldNotBeInstalledCount dpInstExitCode
37 | CopiedToDriverStoreCount = getCopiedToDriverStoreCount dpInstExitCode
38 | CouldNotBeInstalled = getCouldNotBeInstalled dpInstExitCode
39 | RebootNeeded=getRebootNeeded dpInstExitCode
40 | ExitCode=
41 | if(getCouldNotBeInstalled dpInstExitCode) then
42 | 1u
43 | else if (getRebootNeeded dpInstExitCode) then
44 | 3010u
45 | else
46 | 0u
47 | }
48 |
49 |
50 |
51 |
--------------------------------------------------------------------------------
/src/app/DriverTool.DpInstExitCode2ExitCode/DriverTool.DpInstExitCode2ExitCode.fsproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | net48
5 | 1.0.23237.86
6 | 1.0.23237.86
7 | 1.0.23237
8 | Copyright (c) 2018-2023 github/trondr
9 |
10 |
11 | Dummy
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
--------------------------------------------------------------------------------
/src/app/DriverTool.DpInstExitCode2ExitCode/Program.fs:
--------------------------------------------------------------------------------
1 | // Learn more about F# at http://docs.microsoft.com/dotnet/fsharp
2 |
3 | open System
4 | open DriverTool
5 |
6 | []
7 | let main argv =
8 |
9 | if((Array.length argv) <> 1) then
10 | printfn "%s" "Invalid command line."
11 | printfn "%s" "Usage: DriverTool.DpInstExitCode2ExitCode.exe "
12 | printfn "%s" "Example: DriverTool.DpInstExitCode2ExitCode.exe 2"
13 | 13
14 | else
15 | let dpInstexitCodeString = argv.[0]
16 | let exitCode =
17 | match(string2uInt dpInstexitCodeString) with
18 | |Result.Ok dpec ->
19 | let dpInstExitInfo =
20 | DriverTool.DpInstExitCode.toDpInstExitCodeInfo (uint dpec)
21 | printfn "DpInst exit code: 0x%X (%d)" dpInstExitInfo.DpInstExitCode dpInstExitInfo.DpInstExitCode
22 | printfn "Number of driver packages that could not be installed: %d" dpInstExitInfo.CouldNotBeInstalledCount
23 | printfn "Number of driver packages that have been copied to the driver store but haven't been installed on a device: %d" dpInstExitInfo.CopiedToDriverStoreCount
24 | printfn "Number of driver packages that have been installed on a device: %d" dpInstExitInfo.InstalledCount
25 | printfn "Could not be installed: %b" dpInstExitInfo.CouldNotBeInstalled
26 | printfn "Reboot needed: %b" dpInstExitInfo.RebootNeeded
27 | int dpInstExitInfo.ExitCode
28 | |Result.Error ex ->
29 | printfn "ERROR: Failed to convert dup exit code '%s' due to: %s" dpInstexitCodeString ex.Message
30 | 13//Invalid data
31 | exitCode
32 |
33 |
--------------------------------------------------------------------------------
/src/app/DriverTool.DupExitCode2ExitCode/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/app/DriverTool.DupExitCode2ExitCode/AssemblyInfo.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.DupExitCode2ExitCode.AssemblyInfo
2 |
3 | open System.Reflection
4 | open System.Runtime.CompilerServices
5 | open System.Runtime.InteropServices
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | []
11 | []
12 | []
13 | []
14 | []
15 | [ 2018")>]
16 | []
17 | []
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | []
23 |
24 | // The following GUID is for the ID of the typelib if this project is exposed to COM
25 | []
26 |
27 | // Version information for an assembly consists of the following four values:
28 | //
29 | // Major Version
30 | // Minor Version
31 | // Build Number
32 | // Revision
33 | //
34 | // You can specify all the values or you can default the Build and Revision Numbers
35 | // by using the '*' as shown below:
36 | // []
37 | []
38 | []
39 |
40 | do
41 | ()
--------------------------------------------------------------------------------
/src/app/DriverTool.DupExitCode2ExitCode/DriverTool.DupExitCode2ExitCode.fsproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Exe
4 | net48
5 | 1.0.23237.86
6 | 1.0.23237.86
7 | 1.0.23237
8 | Copyright (c) 2018-2023 github/trondr
9 |
10 |
11 | Dummy
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/src/app/DriverTool.DupExitCode2ExitCode/DriverTool.DupExitCode2ExitCode.v3.ncrunchproject:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | CopyReferencedAssembliesToWorkspaceIsOn
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/app/DriverTool.DupExitCode2ExitCode/Program.fs:
--------------------------------------------------------------------------------
1 | open DriverTool.DupExitCode2ExitCode.Dup
2 | open DriverTool
3 | open F
4 |
5 | []
6 | let main argv =
7 |
8 | let argvLength = Array.length argv
9 | if(argvLength <> 1) then
10 | printfn "%s" "Invalid command line."
11 | printfn "%s" "Usage: DriverTool.DupExitCode2ExitCode.exe "
12 | printfn "%s" "Example: DriverTool.DupExitCode2ExitCode.exe 2"
13 | 13
14 | else
15 | let dupExitCodeString = argv.[0]
16 | let exitCode =
17 | match (string2Int dupExitCodeString) with
18 | |Ok dupExitCode ->
19 | let dupExitCodeMessage = dupExitCode2Message dupExitCode
20 | printfn "Dup exit code: %i (%s)" dupExitCode dupExitCodeMessage
21 | let exitCode = dupExitCode2ExitCode dupExitCode
22 | exitCode
23 | |Error ex ->
24 | printfn "ERROR: Failed to convert dup exit code '%s' due to: %s" dupExitCodeString ex.Message
25 | 13 //Invalid data
26 | let exitCodeMessage = win32ErrorCode2Message exitCode
27 | printfn "Win32 exit code: %i (%s)" exitCode exitCodeMessage
28 | exitCode
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/Async.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 |
3 | []
4 | module Async =
5 | open System.Threading
6 | open System.Threading.Tasks
7 | open DriverTool.Library.Logging
8 | let logger = getLoggerByName "Async"
9 |
10 | type Microsoft.FSharp.Control.Async with
11 | static member AwaitTask (t : Task<'T>, timeout : int) =
12 | async {
13 | use cts = new CancellationTokenSource()
14 | use timer = Task.Delay (timeout, cts.Token)
15 | try
16 | let! completed = Async.AwaitTask <| Task.WhenAny(t, timer)
17 | if completed = (t :> Task) then
18 | let! result = Async.AwaitTask t
19 | return Some result
20 | else return None
21 |
22 | finally cts.Cancel()
23 | }
24 |
25 |
26 | let wait seconds continuationMessage =
27 | Async.AwaitTask((System.Threading.Tasks.Task.Delay(seconds * 1000).ContinueWith(fun _ -> logger.Info(sprintf "%s" continuationMessage);None)),6000) |> Async.RunSynchronously |>ignore
28 |
29 | //Source: https://theburningmonk.com/2012/10/f-helper-functions-to-convert-between-asyncunit-and-task/
30 |
31 | let inline awaitPlainTask (task: Task) =
32 | // rethrow exception from preceding task if it fauled
33 | let continuation (t : Task) : unit =
34 | match t.IsFaulted with
35 | | true -> raise t.Exception
36 | | arg -> ()
37 | task.ContinueWith continuation |> Async.AwaitTask
38 |
39 | let inline startAsPlainTask (work : Async) = Task.Factory.StartNew(fun () -> work |> Async.RunSynchronously)
40 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/Cab.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 |
3 | module Cab =
4 |
5 | open System
6 | open DriverTool.Library.Environment
7 |
8 | ///
9 | /// Path to expand.exe
10 | ///
11 | let expandExe =
12 | System.IO.Path.Combine(nativeSystemFolder,"expand.exe")
13 |
14 | let expandExeExitCodeToResult cabFilePath exitCode =
15 | let expandResult =
16 | if(exitCode = 0) then
17 | Result.Ok exitCode
18 | else
19 | Result.Error (new Exception(sprintf "Failed to expand CAB file '%A'. Expand.exe exited with error code: %i. Suggestion: Delete the CAB file and any extracted files, and try again." cabFilePath exitCode))
20 | expandResult
21 |
22 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/Cryptography.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 |
3 | module Cryptography =
4 |
5 | let isTrusted (filePath:FileSystem.Path) =
6 | DriverTool.CSharpLib.Wintrust.IsTrusted(FileSystem.pathValue filePath)
7 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/CsvOperations.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 |
3 | module CsvOperations =
4 |
5 | open System.Globalization
6 |
7 | let exportToCsvUnsafe (csvFilePath:FileSystem.Path, records) =
8 | use sw = new System.IO.StreamWriter(FileSystem.pathValue csvFilePath)
9 |
10 | let csvConfiguration = new CsvHelper.Configuration.CsvConfiguration(CultureInfo.InvariantCulture)
11 | csvConfiguration.Delimiter <- ";"
12 | use csv = new CsvHelper.CsvWriter(sw, csvConfiguration)
13 | csv.WriteRecords(records)
14 | csvFilePath
15 |
16 | let exportToCsv (csvFilePath:FileSystem.Path, records) =
17 | tryCatch (Some (sprintf "Failed to export records to csv file '%A'" csvFilePath)) exportToCsvUnsafe (csvFilePath, records)
18 |
19 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/DellSettings.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool
2 |
3 | module DellSettings =
4 | let downloadsHost = "downloads.dell.com"
5 | let downloadsBaseUrl = "http://" + downloadsHost
6 | let softwareCatalogCab = "http://downloads.dell.com/catalog/CatalogPC.cab"
7 | let driverPackageCatalogCab = "http://downloads.dell.com/catalog/DriverPackCatalog.cab"
8 | let smsSdpCatalog = "http://ftp.dell.com/catalog/DellSDPCatalogPC.cab"
9 | let smsSdpCatalogCabFileName = "DellSDPCatalogPC.cab"
10 | let smsSdpCatalogFolderName = "DellSDPCatalogPC"
11 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/DriverPack.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 |
3 | module DriverPack =
4 | open System
5 |
6 | type WmiQuery = {
7 | Name:string
8 | NameSpace :string
9 | Query :string
10 | }
11 |
12 | ///Information about an enterprise driver pack. An enterprise driver pack contains all drivers for a model. These drivers are "INF" based drivers and consequently injectable using the DISM utility.
13 | type DriverPackInfo = {
14 | Manufacturer:string
15 | Model: string
16 | ModelCodes: string[]
17 | ReadmeFile:DriverTool.Library.Web.WebFile option
18 | InstallerFile:DriverTool.Library.Web.WebFile
19 | Released:DateTime
20 | Os:string
21 | OsBuild:string
22 | ModelWmiQuery:WmiQuery
23 | ManufacturerWmiQuery:WmiQuery
24 | }
25 |
26 | type DownloadedDriverPackInfo = { InstallerPath:string; ReadmePath:string option; DriverPack:DriverPackInfo}
27 |
28 | type ExtractedDriverPackInfoInfo = { ExtractedDirectoryPath:string; DownloadedDriverPackInfo:DownloadedDriverPackInfo;}
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/DriverPacks.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 |
3 | module DriverPacks =
4 | open Microsoft.FSharp.Reflection
5 | open DriverTool.Library.ManufacturerTypes
6 | open DriverTool.Library.Logging
7 |
8 | ///Load driver pack infos for all manufacturers
9 | let loadDriverPackInfos (cacheFolderPath:FileSystem.Path) (reportProgress:reportProgressFunction) =
10 | result{
11 | let updateFunctions =
12 | getValidManufacturers()
13 | |> Array.map (DriverTool.Updates.getDriverPacksFunc)
14 | let! driverPackInfosArrayofArrays = updateFunctions |> Array.map (fun f -> f cacheFolderPath reportProgress) |> toAccumulatedResult
15 | let driverPackInfos = driverPackInfosArrayofArrays |> Seq.toArray |> Array.concat
16 | return driverPackInfos
17 | }
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/DriverTool.Library.v3.ncrunchproject:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | PostBuildEventDisabled
5 |
6 |
7 |
8 |
9 |
10 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/DriverUpdates.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 |
3 | module DriverUpdates =
4 |
5 | open DriverTool.Library.PackageXml
6 |
7 | //Model info record defintion
8 | type ModelInfo = {
9 | Manufacturer: string
10 | ModelCode : string
11 | Name : string
12 | OperatingSystem : string
13 | OsBuild : string
14 | DriverUpdates : PackageInfo []
15 | }
16 |
17 | //Construct a model info record
18 | let toModelInfo manufacturer modelCode name operatingSystem osBuild driverUpdates =
19 | {
20 | Manufacturer = manufacturer
21 | ModelCode = modelCode
22 | Name = name
23 | OperatingSystem = operatingSystem
24 | OsBuild = osBuild
25 | DriverUpdates = driverUpdates
26 | }
27 |
28 | ///Load driver updates for manufacturer, model and operating system
29 | let loadDriverUpdates reportProgress cacheFolderPath manufacturer model modelName operatingSystem osBuild excludeUpdateRegexPatterns =
30 | result{
31 | let driverUpdatesFunction = DriverTool.Updates.getDriverUpdatesFunc manufacturer
32 | let! driverPackInfos = driverUpdatesFunction reportProgress cacheFolderPath model operatingSystem excludeUpdateRegexPatterns
33 | let uniqueDriverUpdates = driverPackInfos |> Array.distinct
34 | let uniqueDriverUpdatesByInstallerName = uniqueDriverUpdates |> DriverTool.CreateDriverPackage.getUniqueUpdatesByInstallerName
35 | let modelInfo = toModelInfo (ManufacturerTypes.manufacturerToName manufacturer) (model.ToString()) modelName (operatingSystem.ToString()) osBuild uniqueDriverUpdatesByInstallerName
36 | return modelInfo
37 | }
38 |
39 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/ExportLocalUpdates.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool
2 |
3 |
4 | module ExportLocalUpdates =
5 | let logger = DriverTool.Library.Logging.getLoggerByName "ExportLocalUpdates"
6 |
7 | open System
8 | open DriverTool.Library.UpdatesContext
9 | open DriverTool.Library.F
10 | open DriverTool.Library
11 |
12 | let exportLocalUpdates cacheFolderPath (csvFilePath:FileSystem.Path) excludeUpdatePatterns =
13 | result{
14 | let! localManufacturer = DriverTool.Library.ManufacturerTypes.manufacturerStringToManufacturer ("",true)
15 | let! localModelCode = ModelCode.create String.Empty true
16 | let! localOperatingSystemCode = OperatingSystemCode.create String.Empty true
17 |
18 | let! logDirectory = FileSystem.path DriverTool.Library.Configuration.getDriverPackageLogDirectoryPath
19 | let! excludeUpdateRegexPatterns = RegExp.toRegexPatterns true excludeUpdatePatterns
20 | let updatesRetrievalContext = toUpdatesRetrievalContext localManufacturer localModelCode localOperatingSystemCode true logDirectory cacheFolderPath true excludeUpdateRegexPatterns
21 | let getUpdates = DriverTool.Updates.getUpdatesFunc (logger,localManufacturer, updatesRetrievalContext.BaseOnLocallyInstalledUpdates)
22 | let! localUpdates = getUpdates cacheFolderPath updatesRetrievalContext
23 | let! exportResult = DriverTool.Library.CsvOperations.exportToCsv (csvFilePath, localUpdates)
24 | logger.Info("Locally installed updates have been exported to file: " + FileSystem.pathValue csvFilePath)
25 | return exportResult
26 | }
27 |
28 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/ExportRemoteUpdates.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool
2 |
3 | module ExportRemoteUpdates =
4 | open DriverTool
5 | open DriverTool.Library.ManufacturerTypes
6 | open DriverTool.Library.UpdatesContext
7 | open DriverTool.Library.F
8 | open DriverTool.Library
9 | open DriverTool.Library.FileOperations
10 |
11 | let exportRemoteUpdates cacheFolderPath logger (manufacturer:Manufacturer) (model: ModelCode) (operatingSystem:OperatingSystemCode) csvFilePath overwrite excludeUpdatePatterns =
12 | result {
13 | let! logDirectory = FileSystem.path DriverTool.Library.Configuration.getDriverPackageLogDirectoryPath
14 | let! excludeUpdateRegexPatterns = RegExp.toRegexPatterns true excludeUpdatePatterns
15 | let updatesRetrievalContext = toUpdatesRetrievalContext manufacturer model operatingSystem overwrite logDirectory cacheFolderPath false excludeUpdateRegexPatterns
16 | let! csvFilePath = ensureFileDoesNotExist overwrite csvFilePath
17 | let getUpdates = DriverTool.Updates.getUpdatesFunc (logger, manufacturer, updatesRetrievalContext.BaseOnLocallyInstalledUpdates)
18 | let! r = getUpdates cacheFolderPath updatesRetrievalContext
19 | let u = Seq.distinct r
20 | let! e = CsvOperations.exportToCsv (csvFilePath, u)
21 | return e
22 | }
23 |
24 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/HtmlHelper.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 |
3 | module HtmlHelper =
4 | open FSharp.Data
5 |
6 | let loadHtmlDocument htmlFilePath =
7 | result
8 | {
9 | let! existinghtmlFilePath = FileOperations.ensureFileExistsWithMessage (sprintf "Html file '%s' not found." (FileSystem.pathValue htmlFilePath)) htmlFilePath
10 | let! htmlContent = FileOperations.readContentFromFile existinghtmlFilePath
11 | let htmlStream = stringToStream htmlContent
12 | return!
13 | try
14 | Result.Ok (HtmlDocument.Load(htmlStream))
15 | with
16 | |ex ->
17 | toErrorResult ex (Some(sprintf "Failed to load html document '%A'." htmlFilePath))
18 | }
19 |
20 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/Init.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 |
3 | []
4 | module Init =
5 | type ThisAssembly = { Empty:string;}
6 |
7 | let resourceAssembly =
8 | typeof.Assembly
9 |
10 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/Messages.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 |
3 | module Messages =
4 | open System
5 | open DriverTool.Library.ManufacturerTypes
6 |
7 | type DriverPackageCreationContext =
8 | {
9 | PackagePublisher:string
10 | Manufacturer:Manufacturer
11 | SystemFamily:SystemFamily
12 | Model:ModelCode
13 | OperatingSystem:OperatingSystemCode
14 | DestinationFolderPath:FileSystem.Path
15 | CacheFolderPath:FileSystem.Path
16 | BaseOnLocallyInstalledUpdates:bool
17 | LogDirectory:FileSystem.Path
18 | ExcludeUpdateRegexPatterns: System.Text.RegularExpressions.Regex[]
19 | PackageTypeName:string
20 | ExcludeSccmPackage:bool
21 | DoNotDownloadSccmPackage:bool
22 | SccmPackageInstaller:string
23 | SccmPackageReadme:string
24 | SccmPackageReleased:DateTime
25 | }
26 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/ModelCode.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 | open System
3 | open DriverTool.Library.SystemInfo
4 |
5 | type InvalidModelCodeException(modelCode:string, message : string) =
6 | inherit Exception(
7 | match String.IsNullOrWhiteSpace(message) with
8 | |false -> sprintf "The model code '%s' is not valid. %s" modelCode message
9 | |true -> sprintf "The model code '%s' is not valid." modelCode
10 | )
11 |
12 | type ModelCode private (modelCode : string) =
13 | member x.Value = modelCode
14 |
15 | static member createWithContinuation success failure (modelCode:string) (defaultToLocal:bool) : Result =
16 | match modelCode with
17 | | modelCode when System.String.IsNullOrWhiteSpace(modelCode) && defaultToLocal ->
18 | match getModelCodeForCurrentSystem() with
19 | | Ok mc -> success (ModelCode mc)
20 | | Error ex -> failure ((new InvalidModelCodeException(String.Empty,sprintf "Failed to get model code for current system. %s" ex.Message)):> Exception)
21 | | modelCode when System.String.IsNullOrWhiteSpace(modelCode) -> failure ((new InvalidModelCodeException(modelCode,"ModelCode cannot be null or empty.")) :> Exception)
22 | | _ -> success (ModelCode modelCode)
23 |
24 | static member create (modelCode : string) (defaultToLocal:bool) =
25 | let success (value : ModelCode) = Result.Ok value
26 | let failure ex = Result.Error ex
27 | ModelCode.createWithContinuation success failure modelCode defaultToLocal
28 |
29 | static member createUnsafe modelCode defaultToLocal=
30 | match(ModelCode.create modelCode defaultToLocal)with
31 | |Result.Ok m -> m
32 | |Result.Error ex -> raise ex
33 |
34 | override x.GetHashCode() =
35 | hash (modelCode)
36 |
37 | override x.Equals(b) =
38 | match b with
39 | | :? ModelCode as m -> (modelCode) = (m.Value)
40 | | _ -> false
41 |
42 | override x.ToString() =
43 | x.Value
44 |
45 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/NCmdLinerMessenger.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 |
3 | module NCmdLinerMessenger =
4 | open System
5 | open System.IO
6 | open NCmdLiner
7 |
8 | type NotepadMessenger () =
9 | let tempFileName =
10 | let tempFile = System.IO.Path.GetTempFileName()
11 | let txtTempFile = tempFile + ".txt"
12 | System.IO.File.Move(tempFile, txtTempFile)
13 | txtTempFile
14 | let streamWriter =
15 | new StreamWriter(tempFileName)
16 | do
17 | ()
18 |
19 | interface IDisposable with
20 | member this.Dispose() =
21 | streamWriter.Dispose()
22 | match (FileSystem.path tempFileName) with
23 | |Ok fp -> (FileOperations.deleteFileIfExists fp)
24 | |Result.Error ex -> ()
25 |
26 | interface IMessenger with
27 | member x.Write (formatMessage:string,args:obj[]) =
28 | streamWriter.Write(formatMessage.Replace("\r\n","\n").Replace("\n",Environment.NewLine),args)
29 | ()
30 | member x.WriteLine (formatMessage:string,args:obj[]) =
31 | streamWriter.WriteLine(formatMessage.Replace("\r\n","\n").Replace("\n",Environment.NewLine),args)
32 | ()
33 | member x.Show () =
34 | streamWriter.Close()
35 | if(Environment.UserInteractive) then
36 | System.Diagnostics.Process.Start(tempFileName) |> ignore
37 | System.Threading.Thread.Sleep(2000)
38 | else
39 | use sr = new StreamReader(tempFileName)
40 | printfn "%s" (sr.ReadToEnd())
41 | ()
42 |
43 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/OperatingSystemOperations.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 |
3 | module OperatingSystemOperations =
4 |
5 | let GetOsShortName () =
6 | OperatingSystem.getOsShortName
7 |
8 | let IsServer () =
9 | OperatingSystem.isServer
10 |
11 | let IsX64 () =
12 | OperatingSystem.isOperatingSystemX64
13 |
14 |
15 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/PackageTemplate/Drivers/DpInstExitCode2ExitCode.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/app/DriverTool.Library/PackageTemplate/Drivers/DpInstExitCode2ExitCode.exe
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/PackageTemplate/Drivers/DpInstExitCode2ExitCode.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/PackageTemplate/Drivers/DriverTool.DupExitCode2ExitCode.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/app/DriverTool.Library/PackageTemplate/Drivers/DriverTool.DupExitCode2ExitCode.exe
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/PackageTemplate/Drivers/DriverTool.DupExitCode2ExitCode.exe.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/PackageTemplate/Drivers/Drivers-README.txt:
--------------------------------------------------------------------------------
1 | Each driver is located in a sub folder in the Drivers folder
2 | Each driver is installed in alphabetical order of the sub folder names
3 | To change the install order, prefix each sub folder so that the prefix controls the required alphabetical order, example 010_*
4 | A sub folder name starting with an underscode (_) is skipped during install. This disables the driver without deleting the containing folder.
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/PackageTemplate/Drivers/FSharp.Core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/app/DriverTool.Library/PackageTemplate/Drivers/FSharp.Core.dll
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/PackageTemplate/Install.cmd:
--------------------------------------------------------------------------------
1 | @Echo Off
2 | @pushd %~dp0
3 |
4 | title Install driver package
5 |
6 | @Echo Run DriverTool InstallDriverPacakge
7 | Set DriverToolExe=%~dp0DriverTool\DriverTool.exe
8 | @Echo DriverToolExe=%DriverToolExe%
9 | "%DriverToolExe%" InstallDriverPackage /driverPackagePath="%~dp0"
10 | @Set ExitCode=%errorlevel%
11 |
12 | @popd
13 | @Echo ExitCode=%ExitCode%
14 | @Exit /B %ExitCode%
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/PackageTemplate/Install.xml:
--------------------------------------------------------------------------------
1 |
2 | %PUBLIC%\LogsTest
3 | DriverPackageInstall-%USERNAME%.log
4 | DriverPackageX
5 | 1.0
6 | 000
7 | MyCompany
8 | LENOVO
9 | 20EQ0022MN
10 | ThinkPad P50
11 | Win10X64
12 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/PackageTemplate/UnInstall.cmd:
--------------------------------------------------------------------------------
1 | @Echo Off
2 | @pushd %~dp0
3 |
4 | title Uninstall driver package
5 |
6 | @Echo Run DriverTool InstallDriverPacakge
7 | Set DriverToolExe=%~dp0DriverTool\DriverTool.exe
8 | @Echo DriverToolExe=%DriverToolExe%
9 | "%DriverToolExe%" UnInstallDriverPackage /driverPackagePath="%~dp0"
10 | @Set ExitCode=%errorlevel%
11 |
12 | @popd
13 | @Echo ExitCode=%ExitCode%
14 | @Exit /B %ExitCode%
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/PackageTemplate/_Compress.cmd:
--------------------------------------------------------------------------------
1 | @Echo Off
2 | @pushd %~dp0
3 |
4 | title Compress .\Drivers folder to .\Drivers.zip
5 |
6 | @Echo Run DriverTool InstallDriverPacakge
7 | Set DriverToolExe=%~dp0DriverTool\DriverTool.exe
8 | @Echo DriverToolExe=%DriverToolExe%
9 | "%DriverToolExe%" CompressDriverPackage /driverPackagePath="%~dp0"
10 | @Set ExitCode=%errorlevel%
11 |
12 | @popd
13 | @Echo ExitCode=%ExitCode%
14 | @Exit /B %ExitCode%
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/PackageTemplate/_Decompress.cmd:
--------------------------------------------------------------------------------
1 | @Echo Off
2 | @pushd %~dp0
3 |
4 | title Decompress .\Drivers.zip to .\Drivers folder
5 |
6 | @Echo Run DriverTool InstallDriverPacakge
7 | Set DriverToolExe=%~dp0DriverTool\DriverTool.exe
8 | @Echo DriverToolExe=%DriverToolExe%
9 | "%DriverToolExe%" DecompressDriverPackage /driverPackagePath="%~dp0"
10 | @Set ExitCode=%errorlevel%
11 |
12 | @popd
13 | @Echo ExitCode=%ExitCode%
14 | @Exit /B %ExitCode%
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/Paths.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 |
3 | module Paths =
4 |
5 | open System.IO
6 |
7 | let HasInvalidPathCharacters (path :string) =
8 | let invalidPathCharacters = Path.GetInvalidPathChars();
9 | if (path.IndexOfAny(invalidPathCharacters) <> -1)
10 | then true
11 | else false
12 |
13 | let HasWildCardCharacters (path :string) =
14 | let wildCardCharcaters = [| '*';'?' |];
15 | if (path.IndexOfAny(wildCardCharcaters) <> -1)
16 | then true
17 | else false
18 |
19 | let IsValidPath (path:string) =
20 | let invalidPath =
21 | System.String.IsNullOrWhiteSpace(path)
22 | || (HasInvalidPathCharacters path)
23 | || (HasWildCardCharacters path)
24 | not invalidPath
25 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/RegExp.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 |
3 | module RegExp =
4 | open System.Text.RegularExpressions
5 | open DriverTool.Library.F0
6 |
7 | ///Get IgnoreCase regex option if ignoreCase is true. Otherwise return regex option None.
8 | let toRegexOptions ignoreCase =
9 | match ignoreCase with
10 | |true ->
11 | System.Text.RegularExpressions.RegexOptions.IgnoreCase
12 | |false ->
13 | System.Text.RegularExpressions.RegexOptions.None
14 |
15 | ///Convert regular expression string to Regex object. If ignoreCase is set to true, case will be ignored when matching Regex
16 | let toRegEx pattern ignoreCase =
17 | try
18 | let regexOptions = toRegexOptions ignoreCase
19 | Result.Ok (new Regex(pattern,regexOptions))
20 | with
21 | |ex -> toErrorResult ex (Some (sprintf "Failed to convert pattern '%s' to RegEx" pattern))
22 |
23 | ///
24 | /// Convert array of string patterns to array of Regex objects. If ignoreCase is set to true, case will be ignored when matching Regex
25 | ///
26 | ///
27 | ///
28 | let toRegexPatterns ignoreCase patterns =
29 | result {
30 | let! regPatterns =
31 | patterns
32 | |>Array.map(fun p -> toRegEx p ignoreCase)
33 | |>toAccumulatedResult
34 | let regPatternsArray = (regPatterns|>Seq.toArray)
35 | return regPatternsArray
36 | }
37 |
38 | ///
39 | /// If any of the regular expressions match the input text, return true
40 | ///
41 | ///
42 | ///
43 | let matchAny excludeRegExPatterns text =
44 | excludeRegExPatterns
45 | |>Array.exists(fun (p:Regex) -> p.IsMatch(text))
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/Requirements.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 |
3 | module Requirements =
4 |
5 | open DriverTool.Library.Environment
6 |
7 | let isAdministrator () =
8 | let windowsIdentity = System.Security.Principal.WindowsIdentity.GetCurrent()
9 | let windowsPrincipal= new System.Security.Principal.WindowsPrincipal(windowsIdentity)
10 | let administratorRole=System.Security.Principal.WindowsBuiltInRole.Administrator
11 | windowsPrincipal.IsInRole(administratorRole)
12 |
13 | let assertIsAdministrator (message) =
14 | let isAdministrator = isAdministrator()
15 | match isAdministrator with
16 | |true -> Result.Ok true
17 | |false-> Result.Error (new System.Exception(message))
18 |
19 | let assertIsRunningNativeProcess message =
20 | match(isNativeProcessBit) with
21 | |true -> Result.Ok true
22 | |false -> Result.Error (new System.Exception(message))
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/SystemFamily.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 | open System
3 | open DriverTool.Library.SystemInfo
4 |
5 | type InvalidSystemFamilyException(systemFamily:string, message : string) =
6 | inherit Exception(
7 | match String.IsNullOrWhiteSpace(message) with
8 | |false -> sprintf "The system family '%s' is not valid. %s" systemFamily message
9 | |true -> sprintf "The system family '%s' is not valid." systemFamily
10 | )
11 |
12 | type SystemFamily private (systemFamily : string) =
13 | member x.Value = systemFamily
14 |
15 | static member createWithContinuation success failure (systemFamily:string) (defaultToLocal:bool) : Result =
16 |
17 | match systemFamily with
18 | | systemFamily when System.String.IsNullOrWhiteSpace(systemFamily) && defaultToLocal ->
19 | match getSystemFamilyForCurrentSystem() with
20 | | Ok sf -> success (SystemFamily sf)
21 | | Error ex -> failure ((new InvalidSystemFamilyException(String.Empty,sprintf "Failed to get system family from WMI. %s" ex.Message)):> Exception)
22 |
23 | | systemFamily when System.String.IsNullOrWhiteSpace(systemFamily) -> failure ((new InvalidSystemFamilyException(systemFamily,"SystemFamily cannot be null or empty.")) :> Exception)
24 | | _ -> success (SystemFamily systemFamily)
25 |
26 | static member create (systemFamily : string) =
27 | let success (value : SystemFamily) = Result.Ok value
28 | let failure ex = Result.Error ex
29 | SystemFamily.createWithContinuation success failure systemFamily
30 |
31 | override x.GetHashCode() =
32 | hash (systemFamily)
33 |
34 | override x.Equals(b) =
35 | match b with
36 | | :? SystemFamily as m -> (systemFamily) = (m.Value)
37 | | _ -> false
38 |
39 | override x.ToString() =
40 | x.Value
41 |
42 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/SystemInfo.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 |
3 | module SystemInfo=
4 | open System
5 | open DriverTool.Library.ManufacturerTypes
6 | open DriverTool.Library.F
7 |
8 | let getModelCodeForCurrentSystem () : Result =
9 | result{
10 | let! manufacturer = DriverTool.Library.ManufacturerTypes.getManufacturerForCurrentSystem ()
11 | let! modelCode =
12 | match manufacturer with
13 | |Manufacturer.Dell _ -> WmiHelper.getWmiPropertyDefault "Win32_ComputerSystem" "SystemSKUNumber"
14 | |Manufacturer.Lenovo _ -> WmiHelper.getWmiPropertyDefault "Win32_ComputerSystem" "Model"
15 | |Manufacturer.HP _ -> WmiHelper.getWmiProperty "root\WMI" "MS_SystemInformation" "BaseBoardProduct"
16 | return modelCode
17 | }
18 |
19 | let getSystemFamilyForCurrentSystem () : Result =
20 | result{
21 | let! manufacturer = DriverTool.Library.ManufacturerTypes.getManufacturerForCurrentSystem ()
22 | let! systemFamily =
23 | match manufacturer with
24 | |Manufacturer.Dell _ -> WmiHelper.getWmiPropertyDefault "Win32_ComputerSystem" "Model"
25 | |Manufacturer.Lenovo _ -> WmiHelper.getWmiPropertyDefault "Win32_ComputerSystem" "SystemFamily"
26 | |Manufacturer.HP _ -> WmiHelper.getWmiPropertyDefault "Win32_ComputerSystem" "Model"
27 | return systemFamily
28 | }
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/Tools/7Zip/7Zip.chm:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/app/DriverTool.Library/Tools/7Zip/7Zip.chm
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/Tools/7Zip/7za.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/app/DriverTool.Library/Tools/7Zip/7za.exe
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/Tools/7Zip/License.txt:
--------------------------------------------------------------------------------
1 | 7-Zip Extra
2 | ~~~~~~~~~~~
3 | License for use and distribution
4 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
5 |
6 | Copyright (C) 1999-2018 Igor Pavlov.
7 |
8 | 7-Zip Extra files are under the GNU LGPL license.
9 |
10 |
11 | Notes:
12 | You can use 7-Zip Extra on any computer, including a computer in a commercial
13 | organization. You don't need to register or pay for 7-Zip.
14 |
15 |
16 | GNU LGPL information
17 | --------------------
18 |
19 | This library is free software; you can redistribute it and/or
20 | modify it under the terms of the GNU Lesser General Public
21 | License as published by the Free Software Foundation; either
22 | version 2.1 of the License, or (at your option) any later version.
23 |
24 | This library is distributed in the hope that it will be useful,
25 | but WITHOUT ANY WARRANTY; without even the implied warranty of
26 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
27 | Lesser General Public License for more details.
28 |
29 | You can receive a copy of the GNU Lesser General Public License from
30 | http://www.gnu.org/
31 |
32 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/Tools/BitLocker/DriverTool Disable BitLocker Protection.cmd:
--------------------------------------------------------------------------------
1 | @Echo Off
2 | @pushd %~dp0
3 |
4 | title DriverTool Resume BitLocker Protection
5 |
6 | :: RunInNativeMode=True: Run script in 64 bit process on 64 bit OS
7 | :: RunInNativeMode=False: Run script in 32 bit process on 64 bit OS
8 | :: RunInNativeMode has no effect on 32 bit OS
9 | @Set RunInNativeMode=True
10 |
11 | IF %RunInNativeMode%==True goto RunInNativeMode
12 | IF %RunInNativeMode%==False goto RunInNonNativeMode
13 |
14 | :RunInNativeMode
15 | @Echo Run script in native mode (64 bit process on 64 bit OS and 32 bit process on 32 bit OS)
16 | IF EXIST "%windir%\sysnative\cmd.exe" (Set WinSysDir=%windir%\sysnative) ELSE (Set WinSysDir=%windir%\System32)
17 | goto RunScript
18 |
19 | :RunInNonNativeMode
20 | @Echo Run script in non-native mode (32 bit process on 64 bit OS and 32 bit process on 32 bit OS)
21 | IF EXIST "%windir%\SysWOW64\cmd.exe" (Set WinSysDir=%windir%\SysWOW64) ELSE (Set WinSysDir=%windir%\System32)
22 | goto RunScript
23 |
24 | :RunScript
25 | Set ManageBdeExe=%WinSysDir%\manage-bde.exe
26 | @Echo ManageBdeExe=%ManageBdeExe%
27 | "%ManageBdeExe%" -protectors -disable C:
28 | @Set ExitCode=%errorlevel%
29 | @Echo ExitCode=%ExitCode%
30 |
31 | Set SchTasksExe=%WinSysDir%\schtasks.exe
32 | @Echo SchTasksExe=%SchTasksExe%
33 | "%SchTasksExe%" /Create /tn "DriverTool Resume BitLocker Protection" /XML "%~dp0DriverTool Resume BitLocker Protection.xml"
34 | @Set ExitCode=%errorlevel%
35 | @Echo ExitCode=%ExitCode%
36 |
37 | @popd
38 | @Echo ExitCode=%ExitCode%
39 | @Exit /B %ExitCode%
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/Tools/BitLocker/DriverTool Resume BitLocker Protection.cmd:
--------------------------------------------------------------------------------
1 | @Echo Off
2 | @pushd %~dp0
3 |
4 | title DriverTool Resume BitLocker Protection
5 |
6 | :: RunInNativeMode=True: Run script in 64 bit process on 64 bit OS
7 | :: RunInNativeMode=False: Run script in 32 bit process on 64 bit OS
8 | :: RunInNativeMode has no effect on 32 bit OS
9 | @Set RunInNativeMode=True
10 |
11 | IF %RunInNativeMode%==True goto RunInNativeMode
12 | IF %RunInNativeMode%==False goto RunInNonNativeMode
13 |
14 | :RunInNativeMode
15 | @Echo Run script in native mode (64 bit process on 64 bit OS and 32 bit process on 32 bit OS)
16 | IF EXIST "%windir%\sysnative\cmd.exe" (Set WinSysDir=%windir%\sysnative) ELSE (Set WinSysDir=%windir%\System32)
17 | goto RunScript
18 |
19 | :RunInNonNativeMode
20 | @Echo Run script in non-native mode (32 bit process on 64 bit OS and 32 bit process on 32 bit OS)
21 | IF EXIST "%windir%\SysWOW64\cmd.exe" (Set WinSysDir=%windir%\SysWOW64) ELSE (Set WinSysDir=%windir%\System32)
22 | goto RunScript
23 |
24 | :RunScript
25 | Set ManageBdeExe=%WinSysDir%\manage-bde.exe
26 | @Echo ManageBdeExe=%ManageBdeExe%
27 | "%ManageBdeExe%" -protectors -enable C:
28 | @Set ExitCode=%errorlevel%
29 | @Echo ExitCode=%ExitCode%
30 |
31 | Set SchTasksExe=%WinSysDir%\schtasks.exe
32 | @Echo SchTasksExe=%SchTasksExe%
33 | "%SchTasksExe%" /Delete /tn "DriverTool Resume BitLocker Protection" /F
34 | @Set ExitCode=%errorlevel%
35 | @Echo ExitCode=%ExitCode%
36 |
37 | del "%~dp0%~n0%~x0"
38 |
39 | @popd
40 | @Echo ExitCode=%ExitCode%
41 | @Exit /B %ExitCode%
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/UpdatesContext.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 |
3 | module UpdatesContext =
4 | open System
5 | open System.Text.RegularExpressions
6 | open DriverTool.Library
7 | open DriverTool.Library.ManufacturerTypes
8 |
9 | type UpdatesRetrievalContext = {
10 | Manufacturer: Manufacturer
11 | Model:DriverTool.Library.ModelCode
12 | OperatingSystem: DriverTool.Library.OperatingSystemCode
13 | Overwrite: bool
14 | LogDirectory:FileSystem.Path
15 | CacheFolderPath:FileSystem.Path
16 | BaseOnLocallyInstalledUpdates:bool
17 | ExcludeUpdateRegexPatterns: Regex[]
18 | }
19 |
20 | let toUpdatesRetrievalContext manufacturer model operatingSystem overwrite logDirectory cacheFolderPath baseOnLocallyInstalledUpdates excludeUpdateRegexPatterns =
21 | {
22 | Manufacturer = manufacturer
23 | Model = model
24 | OperatingSystem = operatingSystem
25 | Overwrite = overwrite
26 | LogDirectory = logDirectory
27 | CacheFolderPath = cacheFolderPath
28 | BaseOnLocallyInstalledUpdates = baseOnLocallyInstalledUpdates
29 | ExcludeUpdateRegexPatterns = excludeUpdateRegexPatterns
30 | }
31 |
32 | type SccmPackageInfoRetrievalContext = {
33 | Manufacturer: Manufacturer
34 | Model:DriverTool.Library.ModelCode
35 | OperatingSystem: DriverTool.Library.OperatingSystemCode
36 | CacheFolderPath:FileSystem.Path
37 | DoNotDownloadSccmPackage:bool
38 | SccmPackageInstaller:string
39 | SccmPackageReadme:string
40 | SccmPackageReleased:DateTime
41 | }
42 |
43 | let toSccmPackageInfoRetrievalContext manufacturer model operatingSystem cacheFolderPath doNotDownloadSccmPackage sccmPackageInstaller sccmPackageReadme sccmPackageReleased =
44 | {
45 | Manufacturer = manufacturer
46 | Model = model
47 | OperatingSystem = operatingSystem
48 | CacheFolderPath=cacheFolderPath
49 | DoNotDownloadSccmPackage=doNotDownloadSccmPackage
50 | SccmPackageInstaller=sccmPackageInstaller
51 | SccmPackageReadme=sccmPackageReadme
52 | SccmPackageReleased=sccmPackageReleased
53 | }
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/WebParsing.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 |
3 | module WebParsing =
4 | let logger = DriverTool.Library.Logging.getLoggerByName "WebParsing"
5 | open DriverTool.Library.F
6 | open DriverTool.Library.FileOperations
7 |
8 | let getContentFromWebPage (uri:string) =
9 | try
10 | logger.Info("Getting html content from: " + uri)
11 | let html = DriverTool.CSharpLib.WebParser.GetWebPageContentUnSafe(uri, logger)
12 | Result.Ok html
13 | with
14 | | ex ->
15 | let msg = sprintf "Failed to get web content for web page '%s' due to %s" uri ex.Message
16 | Result.Error (new System.Exception(msg,ex))
17 |
18 | let downloadWebContent url destinationFilePath refresh =
19 | match (fileExists destinationFilePath) && (not refresh) with
20 | |false ->
21 | result{
22 | let! content = getContentFromWebPage url
23 | let! outputPath =
24 | content |> (writeContentToFile logger destinationFilePath)
25 | return outputPath
26 | }
27 | | true -> Result.Ok destinationFilePath
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/WmiHelper.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 |
3 | module WmiHelper =
4 | open System.Management
5 | open Microsoft.FSharp.Collections
6 | open System
7 | open DriverTool.Library.F0
8 |
9 | let getWmiPropertyDefault (className : string) (propertyName : string) : Result<'T, Exception> =
10 | try
11 | use managementClass = new ManagementClass(className)
12 | use managementObjectCollection = managementClass.GetInstances()
13 | if(managementObjectCollection.Count = 0) then
14 | Result.Error (new System.Exception(sprintf "No instances of wmi class '%s' was found." className))
15 | else
16 | let value =
17 | managementObjectCollection
18 | |> Seq.cast
19 | |> Seq.map(fun (x: ManagementObject) -> x.GetPropertyValue(propertyName))
20 | |> Seq.head
21 | Result.Ok (value :?> 'T)
22 | with
23 | | _ as ex -> toErrorResult ex (Some(sprintf "Failed to get wmi property for class '%s' property name '%s'" className propertyName))
24 |
25 | let getWmiProperty (nameSpace:string) (className : string) (propertyName : string) : Result<'T, Exception> =
26 | try
27 | let managementPath = new ManagementPath(nameSpace)
28 | let scope = new ManagementScope(managementPath)
29 | let queryString = "SELECT * FROM " + className
30 | let query = new ObjectQuery(queryString)
31 | use searcher = new ManagementObjectSearcher(scope,query)
32 | use managementObjectCollection = searcher.Get()
33 | if(managementObjectCollection.Count = 0) then
34 | Result.Error (new System.Exception(sprintf "No instances of wmi class '%s' was found." className))
35 | else
36 | let value =
37 | managementObjectCollection
38 | |> Seq.cast
39 | |> Seq.map(fun (x: ManagementObject) -> x.GetPropertyValue(propertyName))
40 | |> Seq.head
41 | Result.Ok (value :?> 'T)
42 | with
43 | | _ as ex -> toErrorResult ex (Some(sprintf "Failed to get wmi property for namespace '%s' class '%s' property name '%s'" nameSpace className propertyName))
44 |
45 |
--------------------------------------------------------------------------------
/src/app/DriverTool.Library/XmlToolKit.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 |
3 | //Source: https://nbevans.wordpress.com/2015/04/15/super-skinny-xml-document-generation-with-f/
4 |
5 | module XmlToolKit =
6 |
7 | open System.Text
8 | open System.Xml
9 | open System.Xml.Linq
10 | open System.IO
11 |
12 | let XDeclaration version encoding standalone = XDeclaration(version, encoding, standalone)
13 | let XLocalName localName namespaceName = XName.Get(localName, namespaceName)
14 | let XName expandedName = XName.Get(expandedName)
15 | let XDocument xdecl content = XDocument(xdecl, content |> Seq.map (fun v -> v :> obj) |> Seq.toArray)
16 | let XComment (value:string) = XComment(value) :> obj
17 | let XElementNS localName namespaceName content = XElement(XLocalName localName namespaceName, content |> Seq.map (fun v -> v :> obj) |> Seq.toArray) :> obj
18 | let XElement expandedName content = XElement(XName expandedName, content |> Seq.map (fun v -> v :> obj) |> Seq.toArray) :> obj
19 | let XAttributeNS localName namespaceName value = XAttribute(XLocalName localName namespaceName, value) :> obj
20 | let XAttribute expandedName value = XAttribute(XName expandedName, value) :> obj
21 |
22 | type XDocument with
23 | /// Saves the XML document to a MemoryStream using UTF-8 encoding, indentation and character checking.
24 | member doc.Save() =
25 | let ms = new MemoryStream()
26 | use xtw = XmlWriter.Create(ms, XmlWriterSettings(Encoding = Encoding.UTF8, Indent = true, CheckCharacters = true))
27 | doc.Save(xtw)
28 | ms.Position <- 0L
29 | ms
30 |
31 |
--------------------------------------------------------------------------------
/src/app/DriverTool.PowerCLI.Library.CSharp/CmdLets/SendGreetingCommand.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 | using System.Management.Automation; // Windows PowerShell assembly.
7 |
8 | namespace DriverTool.PowerCLI.Library.CSharp.CmdLets
9 | {
10 | ///
11 | /// Send greeting
12 | /// Send greeting to the pipe line.
13 | ///
14 | /// Send-Greeting
15 | ///
16 | ///
17 | [Cmdlet(VerbsCommunications.Send, "Greeting")]
18 | public class SendGreetingCommand : Cmdlet
19 | {
20 | ///
21 | /// Name to greet.
22 | ///
23 | [Parameter(Mandatory = true)]
24 | public string Name { get; set; }
25 |
26 | ///
27 | /// Override the ProcessRecord method to process
28 | /// the supplied user name and write out a
29 | /// greeting to the user by calling the WriteObject
30 | /// method.
31 | ///
32 | protected override void ProcessRecord()
33 | {
34 | WriteObject("Hello " + Name + "!");
35 | }
36 | }
37 | }
38 |
--------------------------------------------------------------------------------
/src/app/DriverTool.PowerCLI.Library.CSharp/DriverTool.PowerCLI.Library.CSharp.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net48
4 | true
5 | true
6 | 1.0.23237.86
7 | 1.0.23237.86
8 | 1.0.23237
9 | Copyright (c) 2018-2023 github/trondr
10 |
11 |
12 | Dummy
13 |
14 |
15 |
16 |
17 |
--------------------------------------------------------------------------------
/src/app/DriverTool.PowerCLI.Library.FSharp/CmdLets/Constants.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.PowerCLI.Library.FSharp.CmdLets
2 |
3 | module Constants =
4 | []
5 | let SingleModelParameterSetName = "SingleModel"
6 |
7 | []
8 | let AllModelsParameterSetName = "AllModels"
9 |
10 | []
11 | let SingleModelLatestParameterSetName = "SingleModelLatest"
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/app/DriverTool.PowerCLI.Library.FSharp/CmdLets/Convert-DtExceptionToMessage.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.PowerCLI.Library.FSharp.CmdLets
2 |
3 | open System.Management.Automation
4 |
5 | module ConvertDtExceptionToMessage =
6 |
7 | ///
8 | /// Convert exception object to message recursively.
9 | /// Convert exception object to message recursing inner exceptions.
10 | ///
11 | /// Convert-DtExceptionToMessage -Exception $ex
12 | ///
13 | ///
14 | []
15 | [)>]
16 | type ConvertDtExceptionToMessage () =
17 | inherit PSCmdlet ()
18 |
19 | ///
20 | /// Exception object
21 | ///
22 | []
23 | member val Exception :System.Exception = null with get,set
24 |
25 | override this.BeginProcessing() =
26 | ()
27 |
28 | override this.ProcessRecord() =
29 | let msg = DriverTool.Library.F0.getAccumulatedExceptionMessages this.Exception
30 | this.WriteObject(msg)
31 |
32 | override this.EndProcessing() =
33 | ()
--------------------------------------------------------------------------------
/src/app/DriverTool.PowerCLI.Library.FSharp/CmdLets/Data.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.PowerCLI.Library.FSharp.CmdLets
2 |
3 | module Data =
4 | open DriverTool.Library
5 | open DriverTool.Library.Logging
6 |
7 | let reportProgressSilently:reportProgressFunction = (fun activity status currentOperation percentComplete isBusy id ->
8 | ()//Do not report progress
9 | )
10 |
11 | let getAllDriverPacks () =
12 | match(result{
13 | let! cacheFolder = DriverTool.Library.FileSystem.path (DriverTool.Library.Configuration.getDownloadCacheDirectoryPath())
14 | let! driverPackInfos = DriverTool.Library.DriverPacks.loadDriverPackInfos cacheFolder reportProgressSilently
15 | return driverPackInfos
16 | })with
17 | |Result.Ok dps -> dps
18 | |Result.Error ex ->
19 | raise ex
20 |
21 | let allDriverPacks = lazy (getAllDriverPacks ())
22 |
23 | ///Get model name
24 | let getModelName manufacturer modelCode (operatingSystem:string) =
25 | let model =
26 | allDriverPacks.Value
27 | |>Array.filter(fun dp -> dp.Manufacturer = manufacturer)
28 | |>Array.filter(fun dp -> dp.ModelCodes|>Array.contains modelCode)
29 | |>Array.filter(fun dp -> dp.Os.ToUpper() = operatingSystem.ToUpper())
30 | |>Array.tryHead
31 | match model with
32 | |Some m -> m.Model
33 | |None -> modelCode
34 |
35 | let getModelCodes manufacturer (driverPacks:DriverPack.DriverPackInfo[]) =
36 | driverPacks
37 | |>Array.filter(fun dp -> dp.Manufacturer = manufacturer)
38 | |>Array.map(fun dp -> dp.ModelCodes |> Array.map(fun m -> m))
39 | |>Array.collect id
40 |
41 | let getOperatingSystems manufacturer modelCode (driverPacks:DriverPack.DriverPackInfo[]) =
42 | driverPacks
43 | |>Array.filter(fun dp -> dp.Manufacturer = manufacturer)
44 | |>Array.filter(fun dp -> dp.ModelCodes |> Array.contains modelCode)
45 | |>Array.map(fun dp-> dp.Os)
46 | |>Array.distinct
47 |
48 | let getOsBuild manufacturer modelCode operatingSystem (driverPacks:DriverPack.DriverPackInfo[]) =
49 | driverPacks
50 | |>Array.filter(fun dp -> dp.Manufacturer = manufacturer)
51 | |>Array.filter(fun dp -> dp.ModelCodes |> Array.contains modelCode)
52 | |>Array.filter(fun dp -> dp.Os = operatingSystem)
53 | |>Array.map(fun dp-> dp.OsBuild)
54 | |>Array.distinct
55 |
56 |
57 |
58 |
59 |
--------------------------------------------------------------------------------
/src/app/DriverTool.PowerCLI.Library.FSharp/CmdLets/Get-DtScriptNewCmPackageFromDriverPackPackageDefinitionSms.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.PowerCLI.Library.FSharp.CmdLets
2 |
3 | open System.Management.Automation
4 | open System.Management.Automation.Language
5 | open DriverTool.Library.F0
6 | open DriverTool.Library
7 |
8 | ///
9 | /// Get script for creating new Sccm Package from DriverPack Package Definition Sms.
10 | /// Get script for creating new Sccm Package from DriverPack Package Definition Sms.
11 | ///
12 | /// Get-DtScriptNewCmPackageFromDriverPackPackageDefinitionSms -Path "\\sccmserver01\PkgSrc\Packages\Package1\PackageDefinition.sms"
13 | ///
14 | ///
15 | []
16 | [)>]
17 | type GetDtScriptNewCmPackageFromDriverPackPackageDefinitionSms () =
18 | inherit PSCmdlet ()
19 |
20 | ///
21 | /// Path to PackageDefinition.sms
22 | ///
23 | []
24 | member val Path : string[] = Array.empty with get,set
25 |
26 | override this.BeginProcessing() =
27 | ()
28 |
29 | override this.ProcessRecord() =
30 | this.Path
31 | |> Array.map(fun p ->
32 | let pd = DriverTool.Library.PackageDefinitionSms.readFromFileUnsafe p
33 | match pd.SourcePath with
34 | |Some sourcePath ->
35 | let sourceFolderPath = DirectoryOperations.getParentFolderPathUnsafe (DriverTool.Library.FileSystem.pathUnSafe sourcePath)
36 | let script = DriverTool.Library.Sccm.toNewCmPackagePSScript sourceFolderPath pd
37 | this.WriteObject(script)
38 | |None ->
39 | let name = (WrappedString.value pd.Name)
40 | raise (toException (sprintf "Source path is missing for %s" name) None)
41 | )
42 | |> ignore
43 | ()
44 |
45 | override this.EndProcessing() =
46 | ()
--------------------------------------------------------------------------------
/src/app/DriverTool.PowerCLI.Library.FSharp/CmdLets/Import-DtDriverPackPackageDefinitionSms.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.PowerCLI.Library.FSharp.CmdLets
2 |
3 | open System.Management.Automation
4 |
5 | ///
6 | /// Import Driver Pack Package Definiton Sms file.
7 | /// Import Driver Pack Package Definiton Sms file.
8 | ///
9 | /// Import-DtDriverPackPackageDefinitionSms Path ""
10 | ///
11 | ///
12 | []
13 | [)>]
14 | type ImportDtDriverPackPackageDefintionSms () =
15 | inherit PSCmdlet ()
16 |
17 | ///
18 | /// ComputerName
19 | ///
20 | []
21 | member val Path :string[] = Array.empty with get,set
22 |
23 | override this.BeginProcessing() =
24 | ()
25 |
26 | override this.ProcessRecord() =
27 | this.Path
28 | |> Array.map(fun p ->
29 | let packageDefinitionSms = DriverTool.Library.PackageDefinitionSms.readFromFileUnsafe p
30 | this.WriteObject(packageDefinitionSms)
31 | )
32 | |> ignore
33 | ()
34 |
35 | override this.EndProcessing() =
36 | ()
--------------------------------------------------------------------------------
/src/app/DriverTool.PowerCLI.Library.FSharp/CmdLets/Test-DtIsDriverUpdateRequired.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.PowerCLI.Library.FSharp.CmdLets
2 |
3 | open System.Management.Automation
4 | open System.Management.Automation.Language
5 | open DriverTool.Library.PackageXml
6 | open DriverTool.Library
7 |
8 | ///
9 | /// Check if driver update is required (applicable and not allready installed) on the current system.
10 | /// Check if driver update is required (applicable and not allready installed) on the current system.
11 | ///
12 | /// Test-DtIsDriverUpdateRequired
13 | ///
14 | ///
15 | []
16 | [)>]
17 | type TestDtIsDriverUpdateRequired () =
18 | inherit PSCmdlet ()
19 |
20 | ///
21 | /// Driver update
22 | ///
23 | []
24 | member val PackageInfo : PackageInfo = PackageInfo.Default with get, set
25 |
26 | ///
27 | /// All driver updates for current model. Must be provided to check for driver update dependencies.
28 | ///
29 | []
30 | member val AllPackageInfos : PackageInfo[] = Array.empty with get, set
31 |
32 | override this.BeginProcessing() =
33 | ()
34 |
35 | override this.ProcessRecord() =
36 | let cacheFolderPath = resultToValueUnsafe (DriverTool.Library.FileSystem.path (DriverTool.Library.Configuration.getDownloadCacheDirectoryPath()))
37 | let currentManufacturer = resultToValueUnsafe (ManufacturerTypes.getManufacturerForCurrentSystem())
38 | let isDriverUpdateRequired = DriverTool.Updates.isDriverUpdateRequiredFunc currentManufacturer
39 | let isRequired = resultToValueUnsafe (isDriverUpdateRequired cacheFolderPath this.PackageInfo this.AllPackageInfos)
40 | this.WriteObject(isRequired)
41 |
42 | override this.EndProcessing() =
43 | ()
--------------------------------------------------------------------------------
/src/app/DriverTool.PowerCLI.Library.FSharp/Debug.txt:
--------------------------------------------------------------------------------
1 | Executeable: c:\Windows\system32\WindowsPowerShell\v1.0\powershell.exe
2 | Arguments: -NoExit -Command "& Import-Module 'C:\Dev\github.trondr\DriverTool\src\app\DriverTool.PowerCLI.Library.FSharp\bin\Debug\net48\DriverTool.PowerCLI.Library.FSharp.dll' -Verbose;Get-DtDriverPack -Manufacturer Lenovo -ModelCode 20EQ -OperatingSystem win10 -Latest | Invoke-DtDownloadDriverPack"
3 |
4 | Arguments: -NoExit -Command "& Import-Module 'C:\Dev\github.trondr\DriverTool\src\app\DriverTool.PowerCLI.Library.FSharp\bin\Debug\net48\DriverTool.PowerCLI.Library.FSharp.dll' -Verbose;Get-DtDriverUpdates -Manufacturer Lenovo -ModelCode 20QW -OperatingSystem WIN10X64"
5 |
6 |
7 | Arguments: -NoExit -Command "& Import-Module 'C:\Dev\github.trondr\DriverTool\src\app\DriverTool.PowerCLI.Library.FSharp\bin\Debug\net48\DriverTool.PowerCLI.Library.FSharp.dll' -Verbose;try{$innerException1 = New-Object -TypeName 'System.Exception' -ArgumentList @('Simulated Inner Exception 1.');$innerException2 = New-Object -TypeName "System.Exception" -ArgumentList @('Simulated Inner Exception 2.',$innerException1);$outerException = New-Object -TypeName 'System.Exception' -ArgumentList @('Simulated Outer Exception.',$innerException2);throw $outerException}catch{Convert-DtExceptionToMessage -Exception $_.Exception}"
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
--------------------------------------------------------------------------------
/src/app/DriverTool.PowerCLI.Library.FSharp/DriverTool.PowerCLI.Library.FSharp.fsproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | net48
4 | true
5 | 3390;$(WarnOn)
6 | true
7 | 1.0.23237.86
8 | 1.0.23237.86
9 | 1.0.23237
10 | Copyright (c) 2018-2023 github/trondr
11 |
12 |
13 | Dummy
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
--------------------------------------------------------------------------------
/src/app/DriverTool.PowerCLI.Library.FSharp/PowerShellProgress.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.PowerCLI.Library.FSharp
2 |
3 | module PowerShellProgress =
4 |
5 | open System.Management.Automation
6 | open System.Threading
7 |
8 | /// Make an operation thread safe by locking access to the operation
9 | let lock (lockObj:obj) f =
10 | Monitor.Enter lockObj
11 | try
12 | f()
13 | finally
14 | Monitor.Exit lockObj
15 |
16 | //Credits: https://stackoverflow.com/questions/12852494/best-way-to-update-cmdlet-progress-from-a-separate-thread
17 | type PowerShellProgressAdapter () =
18 |
19 | member val Finished : bool = false with get,set
20 | member val private _queue : System.Collections.Concurrent.ConcurrentQueue = new System.Collections.Concurrent.ConcurrentQueue() with get
21 | member val private _sync : AutoResetEvent = new AutoResetEvent(false) with get
22 | member val private _lockToken : obj = new obj() with get
23 |
24 | member this.WriteQueue(progressRecord:ProgressRecord) =
25 | lock this._lockToken (fun () ->
26 | this._queue.Enqueue(progressRecord)
27 | this._sync.Set() //Allert that data is available
28 | )
29 |
30 | member this.Listen() =
31 | () //TODO implement listen method
32 | //while(not this.Finished)do
33 | // while(true) do
34 | // lock this._lockToken (fun () ->
35 | // if(this._queue.Count > 0) then
36 | // this._queue.TryDequeue() |> ignore //TODO: get the
37 | // else
38 | // ()
39 | // )
40 |
41 |
--------------------------------------------------------------------------------
/src/app/DriverTool.PowerCLI.Library.FSharp/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "DriverTool.PowerCLI.Library.FSharp": {
4 | "commandName": "Executable",
5 | "executablePath": "c:\\Windows\\system32\\WindowsPowerShell\\v1.0\\powershell.exe",
6 | "commandLineArgs": "-NoExit -Command \"& Import-Module 'C:\\Dev\\github.trondr\\DriverTool\\src\\app\\DriverTool.PowerCLI.Library.FSharp\\bin\\Debug\\net48\\DriverTool.PowerCLI.Library.FSharp.dll' -Verbose;Get-DtDriverUpdates -Manufacturer Lenovo -ModelCode 20QW -OperatingSystem WIN10X64\""
7 | }
8 | }
9 | }
--------------------------------------------------------------------------------
/src/app/DriverTool.UI/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
--------------------------------------------------------------------------------
/src/app/DriverTool.UI/DriverTool.UI.v3.ncrunchproject:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/app/DriverTool.UI/DriverTool.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/app/DriverTool.UI/DriverTool.ico
--------------------------------------------------------------------------------
/src/app/DriverTool.UI/ListViewExtensions.cs:
--------------------------------------------------------------------------------
1 | //Source: https://stackoverflow.com/questions/31176949/binding-selecteditems-of-listview-to-viewmodel/31178953
2 |
3 | using System.Collections;
4 | using System.Windows;
5 | using System.Windows.Controls;
6 | using System.Windows.Controls.Primitives;
7 |
8 | namespace DriverTool.UI
9 | {
10 | public class ListViewExtensions
11 | {
12 |
13 | private static SelectedItemsBinder GetSelectedValueBinder(DependencyObject obj)
14 | {
15 | return (SelectedItemsBinder)obj.GetValue(SelectedValueBinderProperty);
16 | }
17 |
18 | private static void SetSelectedValueBinder(DependencyObject obj, SelectedItemsBinder items)
19 | {
20 | obj.SetValue(SelectedValueBinderProperty, items);
21 | }
22 |
23 | private static readonly DependencyProperty SelectedValueBinderProperty = DependencyProperty.RegisterAttached("SelectedValueBinder", typeof(SelectedItemsBinder), typeof(ListViewExtensions));
24 |
25 |
26 | public static readonly DependencyProperty SelectedValuesProperty = DependencyProperty.RegisterAttached("SelectedValues", typeof(IList), typeof(ListViewExtensions),
27 | new FrameworkPropertyMetadata(null, OnSelectedValuesChanged));
28 |
29 |
30 | private static void OnSelectedValuesChanged(DependencyObject o, DependencyPropertyChangedEventArgs value)
31 | {
32 | var oldBinder = GetSelectedValueBinder(o);
33 | oldBinder?.UnBind();
34 | SetSelectedValueBinder(o, new SelectedItemsBinder((ListView)o, (IList)value.NewValue));
35 | GetSelectedValueBinder(o).Bind();
36 | }
37 |
38 | public static void SetSelectedValues(Selector elementName, IEnumerable value)
39 | {
40 | elementName.SetValue(SelectedValuesProperty, value);
41 | }
42 |
43 | public static IEnumerable GetSelectedValues(Selector elementName)
44 | {
45 | return (IEnumerable)elementName.GetValue(SelectedValuesProperty);
46 | }
47 | }
48 | }
--------------------------------------------------------------------------------
/src/app/DriverTool.UI/LoggerTraceListener.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using Common.Logging;
3 |
4 | namespace DriverTool.UI
5 | {
6 | internal class LoggerTraceListener : TraceListener
7 | {
8 | private readonly ILog _logger;
9 |
10 | public LoggerTraceListener(ILog logger)
11 | {
12 | _logger = logger;
13 | }
14 |
15 | public override void Write(string message)
16 | {
17 | _logger.Warn(message);
18 | }
19 |
20 | public override void WriteLine(string message)
21 | {
22 | //Debugger.Break()
23 | _logger.Warn(message);
24 | }
25 | }
26 | }
--------------------------------------------------------------------------------
/src/app/DriverTool.UI/MainWindow.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Windows;
2 |
3 | namespace DriverTool.UI
4 | {
5 | ///
6 | /// Interaction logic for MainWindow.xaml
7 | ///
8 | public partial class MainWindow : Window
9 | {
10 | public MainWindow()
11 | {
12 | InitializeComponent();
13 | }
14 | }
15 | }
16 |
--------------------------------------------------------------------------------
/src/app/DriverTool.UI/Properties/Settings.Designer.cs:
--------------------------------------------------------------------------------
1 | //------------------------------------------------------------------------------
2 | //
3 | // This code was generated by a tool.
4 | // Runtime Version:4.0.30319.42000
5 | //
6 | // Changes to this file may cause incorrect behavior and will be lost if
7 | // the code is regenerated.
8 | //
9 | //------------------------------------------------------------------------------
10 |
11 | namespace DriverTool.UI.Properties {
12 |
13 |
14 | [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
15 | [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "16.8.1.0")]
16 | internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase {
17 |
18 | private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings())));
19 |
20 | public static Settings Default {
21 | get {
22 | return defaultInstance;
23 | }
24 | }
25 | }
26 | }
27 |
--------------------------------------------------------------------------------
/src/app/DriverTool.UI/Properties/Settings.settings:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/src/app/DriverTool.UI/StartUI.cs:
--------------------------------------------------------------------------------
1 | using System.Diagnostics;
2 | using Common.Logging;
3 | using System.Windows;
4 |
5 | namespace DriverTool.UI
6 | {
7 | public static class StartUi
8 | {
9 | private static ILog _logger;
10 |
11 | public static int Start(ILog logger)
12 | {
13 | _logger = logger;
14 | logger.Info("Starting CM device driver user interface.");
15 | var app = new Application();
16 | app.Startup += AppOnStartup;
17 | var windows = new MainWindow();
18 | app.Run(windows);
19 | logger.Info("Stopping CM device driver user interface.");
20 | return 0;
21 | }
22 |
23 | private static void AppOnStartup(object sender, StartupEventArgs e)
24 | {
25 | PresentationTraceSources.Refresh();
26 | PresentationTraceSources.DataBindingSource.Listeners.Add(new LoggerTraceListener(_logger));
27 | PresentationTraceSources.DataBindingSource.Switch.Level = SourceLevels.Warning | SourceLevels.Error | SourceLevels.Critical;
28 | }
29 | }
30 | }
31 |
--------------------------------------------------------------------------------
/src/app/DriverTool.UI/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
--------------------------------------------------------------------------------
/src/app/DriverTool/App.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
--------------------------------------------------------------------------------
/src/app/DriverTool/Credits/01. NCmdLiner Credit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | NCmdLiner
4 | https://github.com/trondr
5 | DriverTool uses NCmdLiner to provide command line parsing and this automatic documentation.
6 |
--------------------------------------------------------------------------------
/src/app/DriverTool/Credits/02. serilog Credit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | serilog
4 | https://github.com/serilog/serilog
5 | DriverTool uses serilog to provide industry standard logging.
6 |
--------------------------------------------------------------------------------
/src/app/DriverTool/Credits/03. Nunit Credit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | Nunit
4 | http://nunit.org/
5 | DriverTool uses Nunit for faciliation of unit testing.
6 |
7 |
--------------------------------------------------------------------------------
/src/app/DriverTool/Credits/04. CsvHelper Credit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | CsvHelper
4 | https://github.com/JoshClose/CsvHelper
5 | DriverTool uses CsvHelper for export and import of data to and from csv file.
6 |
7 |
--------------------------------------------------------------------------------
/src/app/DriverTool/Credits/05. mvvm-helpers Credit.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | mvvm-helpers
4 | https://github.com/jamesmontemagno/mvvm-helpers
5 | DriverTool uses MvvmHelpers to build mvvm user interface.
6 |
7 |
--------------------------------------------------------------------------------
/src/app/DriverTool/DriverTool.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/app/DriverTool/DriverTool.ico
--------------------------------------------------------------------------------
/src/app/DriverTool/DriverTool.v3.ncrunchproject:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Libs\FSharp.Data.DesignTime.dll
5 |
6 |
7 | PostBuildEventDisabled
8 | UnnecessaryFileIncludeWarning
9 |
10 |
11 |
12 |
13 |
14 |
--------------------------------------------------------------------------------
/src/app/DriverTool/Init.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool
2 |
3 | []
4 | module Init =
5 | type ThisAssembly = { Empty:string;}
6 |
7 | let resourceAssembly =
8 | typeof.Assembly
--------------------------------------------------------------------------------
/src/app/DriverTool/License/00. DriverTool License.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | DriverTool
4 |
5 | New BSD License (BSD) http://www.opensource.org/licenses/BSD-3-Clause
6 |
7 | Copyright (c) 2018-2023 github/trondr
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without
11 | modification, are permitted provided that the following conditions are met:
12 |
13 | * Redistributions of source code must retain the above copyright notice, this
14 | list of conditions and the following disclaimer.
15 |
16 | * Redistributions in binary form must reproduce the above copyright notice,
17 | this list of conditions and the following disclaimer in the documentation
18 | and/or other materials provided with the distribution.
19 |
20 | * Neither the name of DriverTool nor the names of its
21 | contributors may be used to endorse or promote products derived from
22 | this software without specific prior written permission.
23 |
24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
25 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
26 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
28 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
29 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
30 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
32 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
33 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 |
35 |
--------------------------------------------------------------------------------
/src/app/DriverTool/License/01. NCmLiner License.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | NCmdLiner
4 | https://github.com/trondr
5 | New BSD License (BSD) http://www.opensource.org/licenses/BSD-3-Clause
6 |
7 | Copyright © <github.com/trondr> 2013-2015
8 | All rights reserved.
9 |
10 | Redistribution and use in source and binary forms, with or without
11 | modification, are permitted provided that the following conditions are met:
12 | * Redistributions of source code must retain the above copyright
13 | notice, this list of conditions and the following disclaimer.
14 | * Redistributions in binary form must reproduce the above copyright
15 | notice, this list of conditions and the following disclaimer in the
16 | documentation and/or other materials provided with the distribution.
17 | * Neither the name of the copyright holder nor the
18 | names of his contributors may be used to endorse or promote products
19 | derived from this software without specific prior written permission.
20 |
21 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
22 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY
25 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
27 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
28 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
30 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 |
32 |
--------------------------------------------------------------------------------
/src/app/DriverTool/License/02. serilog License.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | serilog
4 | https://github.com/serilog/serilog
5 | Apache License, Version 2.0, January 2004, http://www.apache.org/licenses/
6 |
7 | Copyright 2013-2021 serilog
8 |
9 | Licensed under the Apache License, Version 2.0 (the "License");
10 | you may not use this file except in compliance with the License.
11 | You may obtain a copy of the License at
12 |
13 | http://www.apache.org/licenses/LICENSE-2.0
14 |
15 | Unless required by applicable law or agreed to in writing, software
16 | distributed under the License is distributed on an "AS IS" BASIS,
17 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 | See the License for the specific language governing permissions and
19 | limitations under the License.
20 |
21 |
--------------------------------------------------------------------------------
/src/app/DriverTool/Program.fs:
--------------------------------------------------------------------------------
1 | open System
2 | open DriverTool.RunCommand
3 |
4 | let resolveEventHandler =
5 | let lenovoSystemUpdateFolder=
6 | let programFilesFolderX86 =
7 | System.Environment.GetFolderPath(Environment.SpecialFolder.ProgramFilesX86)
8 | System.IO.Path.Combine(programFilesFolderX86,"Lenovo","System Update")
9 |
10 | let assemblySearchPaths =
11 | [|
12 | lenovoSystemUpdateFolder
13 | |]
14 |
15 | let assemblyResolveHandler =
16 | let resourceAssembly = typeof.Assembly
17 | let resourceNameSpace = typeof.Namespace
18 | DriverTool.Library.AssemblyResolver.assemblyResolveHandlerPartial resourceAssembly resourceNameSpace assemblySearchPaths
19 |
20 | new ResolveEventHandler(fun s e -> assemblyResolveHandler(s,e))
21 |
22 | let setup() =
23 | AppDomain.CurrentDomain.add_AssemblyResolve(resolveEventHandler)
24 | AppDomain.CurrentDomain.UnhandledException.AddHandler(fun _ x -> printfn "%s" (x.ExceptionObject.ToString()))
25 |
26 | let teardown() =
27 | AppDomain.CurrentDomain.remove_AssemblyResolve(resolveEventHandler)
28 | AppDomain.CurrentDomain.UnhandledException.RemoveHandler(fun _ x -> printfn "%s" (x.ExceptionObject.ToString()))
29 |
30 | []
31 | [< STAThread >]
32 | let main argv =
33 | setup()
34 | let exitCode = runCommand argv
35 | teardown()
36 | exitCode // return an integer exit code
37 |
--------------------------------------------------------------------------------
/src/app/DriverTool/Properties/launchSettings.json:
--------------------------------------------------------------------------------
1 | {
2 | "profiles": {
3 | "DriverTool": {
4 | "commandName": "Project",
5 | "commandLineArgs": "CmUi"
6 | }
7 | }
8 | }
--------------------------------------------------------------------------------
/src/app/DriverTool/Run.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Library
2 | module Run=
3 |
4 | open NCmdLiner
5 | open DriverTool.Library.Logging
6 |
7 | let run applicationName applicationVersion (logger:Common.Logging.ILog) (runex: unit -> Result) =
8 | logger.Info(sprintf "Start: %s.%s. Command Line: %s" applicationName applicationVersion System.Environment.CommandLine)
9 | logger.Info("ComputerName: " + System.Environment.MachineName)
10 | logger.Info("UserName: " + System.Environment.UserName)
11 | logger.Info("UserDomain: " + System.Environment.UserDomainName)
12 | logger.Info(sprintf "UserInteractive: %b" System.Environment.UserInteractive)
13 | logger.Info(sprintf "Is Administrator: %b" (Environment.isAdministrator()) )
14 | logger.Info(sprintf "Is X64 bit Operating System: %b" System.Environment.Is64BitOperatingSystem)
15 | logger.Info("Process Bit: " + DriverTool.Library.Environment.processBit)
16 | logger.Info(sprintf "Is native process bit: %b (64 bit process on a 64 bit operating system, 32 bit process on a 32 bit operatings system)" DriverTool.Library.Environment.isNativeProcessBit)
17 | let result = runex()
18 | let exitCode =
19 | match result.IsSuccess with
20 | |true -> result.Value
21 | |false ->
22 | result.OnFailure(new System.Action(fun ex -> logger.Error(sprintf "%A" ex)))|> ignore
23 | 1
24 | logger.Info(sprintf "Stop: %s.%s Exit code: %i" applicationName applicationVersion exitCode)
25 | exitCode
26 |
27 |
--------------------------------------------------------------------------------
/src/app/DriverTool/RunCommand.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool
2 |
3 | module RunCommand =
4 | open DriverTool.Commands
5 | open DriverTool.Library
6 | open DriverTool.Library.Logging
7 | open DriverTool.Library.NCmdLinerMessenger
8 | open DriverTool.Library.Run
9 |
10 | let applicationVersion =
11 | System.Reflection.Assembly.GetExecutingAssembly().GetName().Version.ToString()
12 |
13 | let applicationName =
14 | "DriverTool"
15 |
16 | let runCommand args =
17 | configureLogging ()
18 | let logger = getLoggerByName applicationName
19 | let exitCode = run applicationName applicationVersion logger (fun () -> NCmdLiner.CmdLinery.RunEx(typedefof, args, new NotepadMessenger()))
20 | exitCode
--------------------------------------------------------------------------------
/src/app/DriverTool/Script.fsx:
--------------------------------------------------------------------------------
1 |
2 |
3 |
--------------------------------------------------------------------------------
/src/graphics/ConvertToIco.cmd:
--------------------------------------------------------------------------------
1 | Set SourcePngBaseFileName=DriverTool
2 | REM choco install imagemagick
3 | Set ConvertExe="C:\Program Files\ImageMagick-7.1.0-Q16-HDRI\magick.exe"
4 | %ConvertExe% %SourcePngBaseFileName%.png -resize 256x256 %SourcePngBaseFileName%-256.png
5 | %ConvertExe% %SourcePngBaseFileName%-256.png -resize 16x16 %SourcePngBaseFileName%-16.png
6 | %ConvertExe% %SourcePngBaseFileName%-256.png -resize 32x32 %SourcePngBaseFileName%-32.png
7 | %ConvertExe% %SourcePngBaseFileName%-256.png -resize 64x64 %SourcePngBaseFileName%-64.png
8 | %ConvertExe% %SourcePngBaseFileName%-256.png -resize 128x128 %SourcePngBaseFileName%-128.png
9 | %ConvertExe% %SourcePngBaseFileName%-16.png %SourcePngBaseFileName%-32.png %SourcePngBaseFileName%-64.png %SourcePngBaseFileName%-128.png %SourcePngBaseFileName%-256.png %SourcePngBaseFileName%.ico
10 | pause
--------------------------------------------------------------------------------
/src/graphics/DriverTool-128.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/graphics/DriverTool-128.png
--------------------------------------------------------------------------------
/src/graphics/DriverTool-16.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/graphics/DriverTool-16.png
--------------------------------------------------------------------------------
/src/graphics/DriverTool-256.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/graphics/DriverTool-256.png
--------------------------------------------------------------------------------
/src/graphics/DriverTool-32.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/graphics/DriverTool-32.png
--------------------------------------------------------------------------------
/src/graphics/DriverTool-64.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/graphics/DriverTool-64.png
--------------------------------------------------------------------------------
/src/graphics/DriverTool.ico:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/graphics/DriverTool.ico
--------------------------------------------------------------------------------
/src/graphics/DriverTool.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/graphics/DriverTool.png
--------------------------------------------------------------------------------
/src/test/DriverTool.PowerCLI.Library.Tests/DriverTool.PowerCLI.Library.Tests.fsproj:
--------------------------------------------------------------------------------
1 |
2 |
3 | Library
4 | net48
5 | true
6 | 3390;$(WarnOn)
7 | true
8 | 1.0.23237.86
9 | 1.0.23237.86
10 | 1.0.23237
11 | Copyright (c) 2018-2023 github/trondr
12 |
13 |
14 | Dummy
15 |
16 |
17 |
18 |
19 |
20 |
21 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/src/test/DriverTool.PowerCLI.Library.Tests/ExampleTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.PowerCLI.Library.Tests
2 |
3 | module ExampleTests =
4 | open System
5 | open NUnit.Framework
6 | open DriverTool.PowerCLI.Library
7 |
8 | []
9 | []
10 | let exampleTest1 () =
11 | Assert.IsTrue(true,"Example Test expected to succede.")
12 | ()
--------------------------------------------------------------------------------
/src/test/DriverTool.PowerCLI.Library.Tests/Init.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.PowerCLI.Library.Tests
2 |
3 | []
4 | module Init =
5 | type ThisTestAssembly = { Empty:unit;}
6 | open Serilog
7 |
8 | let getConsoleDebugLogger (loggerName:string) =
9 | let log = Serilog.LoggerConfiguration()
10 | .MinimumLevel.Is(Serilog.Events.LogEventLevel.Debug)
11 | .Enrich.FromLogContext()
12 | .WriteTo.Console()
13 | .CreateLogger()
14 | Serilog.Log.Logger <- log
15 | Common.Logging.LogManager.Adapter <- (new Common.Logging.Serilog.SerilogFactoryAdapter())
16 | Common.Logging.LogManager.GetLogger(loggerName)
17 |
18 | []
19 | module TestCategory=
20 | []
21 | let UnitTests = "UnitTests"
22 | []
23 | let IntegrationTests = "IntegrationTests"
24 | []
25 | let ManualTests = "ManualTests"
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/AssemblyInfo.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 |
3 | open System.Reflection
4 | open System.Runtime.CompilerServices
5 | open System.Runtime.InteropServices
6 |
7 | // General Information about an assembly is controlled through the following
8 | // set of attributes. Change these attribute values to modify the information
9 | // associated with an assembly.
10 | []
11 | []
12 | []
13 | []
14 | []
15 | [ 2018")>]
16 | []
17 | []
18 |
19 | // Setting ComVisible to false makes the types in this assembly not visible
20 | // to COM components. If you need to access a type in this assembly from
21 | // COM, set the ComVisible attribute to true on that type.
22 | []
23 |
24 | // The following GUID is for the ID of the typelib if this project is exposed to COM
25 | []
26 |
27 | // Version information for an assembly consists of the following four values:
28 | //
29 | // Major Version
30 | // Minor Version
31 | // Build Number
32 | // Revision
33 | //
34 | // You can specify all the values or you can default the Build and Revision Numbers
35 | // by using the '*' as shown below:
36 | // []
37 | []
38 | []
39 |
40 | do
41 | ()
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/AssemblyResolveTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 |
3 | open NUnit.Framework
4 |
5 | []
6 | []
7 | module AssemblyResolveTests =
8 | open DriverTool.Tests.Init
9 | open DriverTool.Library.AssemblyResolver
10 | open System.Reflection
11 |
12 | []
13 | []
14 | []
15 | let loadAssemblyFromSearchPathTest (fileExists:bool, isNonNull:bool) =
16 |
17 | let fileExistStub (filePath:string) =
18 | fileExists
19 |
20 | let assemblyLoadStub (filePath:string) =
21 | match fileExists with
22 | |true -> typeof.Assembly
23 | |false -> null
24 |
25 | let searchPaths = [|@"c:\temp";@"c:\temp2"|]
26 |
27 | let actual = loadAssemblyFromSearchPathBase (assemblyLoadStub,fileExistStub,searchPaths,new AssemblyName("SomeAssembly"))
28 | Assert.IsTrue((actual<>null) = isNonNull)
29 | ()
30 |
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/BitLockerOperationsTest.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 |
3 | open NUnit.Framework
4 |
5 | []
6 | []
7 | module BitLockerOperationsTest =
8 | open DriverTool.Library
9 |
10 | []
11 | let isBitLockerEnabledTest () =
12 | if(not (Requirements.isAdministrator())) then
13 | Assert.Inconclusive("This test must be run with admin privileges.")
14 | else
15 | let actual = DriverTool.BitLockerOperations.isBitLockerEnabled()
16 | Assert.IsNotNull(actual,"Was null")
17 | ()
18 |
19 |
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/CryptographyTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 |
3 | open NUnit.Framework
4 |
5 | []
6 | []
7 | module CryptographyTests =
8 | open DriverTool
9 | open DriverTool.Library.F
10 | open Init
11 | open DriverTool.Library
12 |
13 | []
14 | []
15 | []
16 | let isTrustedTests (fileName:string, expected:bool) =
17 | match (result
18 | {
19 | let! destinationFolderPath = FileSystem.path (System.IO.Path.GetTempPath())
20 | let assembly = typeof.Assembly
21 | let! extractedFilePath = EmbeddedResource.extractEmbeddedResourceByFileNameBase (fileName,destinationFolderPath,fileName,assembly)
22 | let actual = Cryptography.isTrusted extractedFilePath
23 | Assert.AreEqual(expected,actual)
24 | return extractedFilePath
25 | }) with
26 | |Ok r -> Assert.IsTrue(true)
27 | |Error ex -> Assert.Fail(ex.Message)
28 |
29 |
30 |
31 |
32 |
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/CsvOperationTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 |
3 | open NUnit.Framework
4 |
5 | []
6 | []
7 | module CsvOperationTests =
8 | open DriverTool.Library.FileOperations
9 | open DriverTool.Library.PathOperations
10 | open DriverTool.Library.DirectoryOperations
11 | open DriverTool.Library.F
12 | open DriverTool.Library
13 |
14 | let logger = Common.Logging.Simple.ConsoleOutLogger("CsvOperationTests",Common.Logging.LogLevel.All,true,true,true,"yyyy-MM-dd-HH-mm-ss-ms")
15 |
16 | type CsvData =
17 | {
18 | Col1: string
19 | Col2: string
20 | }
21 |
22 | []
23 | let csvExportTests () =
24 | match(result{
25 | let expectedCsvContent =
26 | [
27 | "Col1;Col2"
28 | "L1v1;L1v2"
29 | "L2v1;L2v2"
30 | "\"L3; v1\";L3v2"
31 | ""
32 | ]|> String.concat System.Environment.NewLine
33 | let records = [|{Col1="L1v1";Col2="L1v2"};{Col1="L2v1";Col2="L2v2"};{Col1="L3; v1";Col2="L3v2"}|]
34 | use temporaryFolder = new TemporaryFolder(logger)
35 | let! temporaryFolderPath = temporaryFolder.FolderPath
36 | let! temporaryFilePath = combine2Paths ((FileSystem.pathValue temporaryFolderPath),getRandomFileName())
37 | let! outputCsvPath = CsvOperations.exportToCsv (temporaryFilePath,records)
38 | let! actualCsvContent = readContentFromFile outputCsvPath
39 | Assert.AreEqual(expectedCsvContent,actualCsvContent,"Csv file content is not as expected")
40 | return actualCsvContent
41 | })with
42 | |Result.Ok v -> Assert.IsTrue(true)
43 | |Result.Error ex -> Assert.Fail(getAccumulatedExceptionMessages ex)
44 |
45 |
46 |
47 |
48 | ()
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/DellDriverPackCatalogTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 |
3 | open NUnit.Framework
4 |
5 | []
6 | []
7 | module DellDriverPackCatalogTests =
8 | open DriverTool.Library
9 | open DriverTool.Library.DellDriverPackCatalog
10 | open DriverTool.Tests.Init
11 |
12 | []
13 | let setup () =
14 | DriverTool.Library.Logging.configureConsoleLogging()
15 |
16 | []
17 | []
18 | let loadCatalogTest () =
19 | match(result{
20 | use temporaryCacheFolder = new DirectoryOperations.TemporaryFolder(logger)
21 | let! temproaryCacheFolderPath = temporaryCacheFolder.FolderPath
22 | let driverPackCatalogXmlFileName = "DriverPackCatalog.xml"
23 | logger.Info(sprintf "Extract from embeded resource: %s" driverPackCatalogXmlFileName)
24 | let! catalogPath = EmbeddedResource.extractEmbeddedResourceByFileNameBase (driverPackCatalogXmlFileName,temproaryCacheFolderPath,driverPackCatalogXmlFileName,typeof.Assembly)
25 | let! actual = DriverTool.Library.DellDriverPackCatalog.loadCatalog catalogPath //Result.Error (toException "Not imlemented" None)
26 | Assert.IsTrue(actual.Length > 0,"Did not load any DriverPackage's")
27 | actual |> Array.map(fun p ->
28 | logger.Info(sprintf "Checking DriverPackage: %A" p)
29 | Assert.IsFalse(System.String.IsNullOrWhiteSpace(p.Name),"DriverPackage.Name is null or empty")
30 | Assert.IsFalse(p.Name.Contains("DisplayName"),"DriverPackage.Name contains 'DisplayName'")
31 |
32 | Assert.IsTrue(p.Models.Length >= 0,sprintf "No supported models for model '%A'" p)
33 |
34 | Assert.IsTrue(p.OperatinSystems.Length > 0,sprintf "No supported operatingsystems for model '%A'" p)
35 |
36 | Assert.IsTrue(p.Installer.Size > 0L, "Size of installer is not greater than 0.")
37 |
38 | Assert.IsTrue(p.PackageType = "winpe" || p.PackageType = "win")
39 | ) |> ignore
40 |
41 |
42 | return actual
43 | }) with
44 | |Result.Ok a -> Assert.IsTrue(a.Length > 0)
45 | |Result.Error ex -> Assert.Fail(ex.Message)
46 |
47 |
48 |
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/DirectoryOperationTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 |
3 | module DirectoryOperationTests=
4 | open NUnit.Framework
5 | open DriverTool.Library.DirectoryOperations
6 | open DriverTool.Library.F
7 | open DriverTool.Library.FileSystem
8 | open DriverTool.Library.PathOperations
9 |
10 | []
11 | []
12 | let ``moveDirectoryUnsafe target base folder does not exist `` () =
13 | match(result{
14 | //Create test source folder
15 | let! tempSourcePath = path (System.IO.Path.Combine(System.IO.Path.GetTempPath(),System.Guid.NewGuid().ToString(),"source"))
16 | let! existingTempSourcePath = ensureDirectoryExists true tempSourcePath
17 | let! tempTargetPathBase = path (System.IO.Path.Combine(System.IO.Path.GetTempPath(),System.Guid.NewGuid().ToString()))
18 | let! existingTempTargetBase = ensureDirectoryExists true tempTargetPathBase
19 | let! tempTargetPath = combinePaths2 existingTempTargetBase "target"
20 | moveDirectoryUnsafe existingTempSourcePath tempTargetPath
21 | return tempSourcePath
22 | })with
23 | |Result.Ok v ->
24 | Assert.IsTrue(true)
25 | |Result.Error ex ->
26 | Assert.IsTrue(false,ex.Message)
27 |
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/DpInstExitCode2ExitCodeTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool
2 |
3 | open NUnit.Framework
4 |
5 | []
6 | module DpInstExitCode2ExitCodeTests =
7 | open System
8 | open DriverTool
9 |
10 | []
11 | []
12 | let DpInstExitCode2ExitCodeTests (dpInstExitCode:uint, expectedInstalledCount:uint, expectedCouldNotBeInstalledCount:uint, expectedCopiedToDriverStoreCount:uint,expectedCouldNotBeInstalled:bool,expectedRebootNeeded:bool,expectedExitCode:uint) =
13 | let actual = DpInstExitCode.toDpInstExitCodeInfo dpInstExitCode
14 | Assert.AreEqual(expectedInstalledCount,actual.InstalledCount,nameof actual.InstalledCount);
15 | Assert.AreEqual(expectedCouldNotBeInstalledCount, actual.CouldNotBeInstalledCount, nameof actual.CouldNotBeInstalledCount);
16 | Assert.AreEqual(expectedCopiedToDriverStoreCount, actual.CopiedToDriverStoreCount, nameof actual.CopiedToDriverStoreCount);
17 | Assert.AreEqual(expectedCouldNotBeInstalled, actual.CouldNotBeInstalled, nameof actual.CouldNotBeInstalled);
18 | Assert.AreEqual(expectedRebootNeeded, actual.RebootNeeded, nameof actual.RebootNeeded);
19 | Assert.AreEqual(expectedExitCode, actual.ExitCode, nameof actual.ExitCode);
20 |
21 |
22 | []
23 | []
24 | []
25 | []
26 | []
27 | []
28 | let toExitCodeTest (dpInstExitCode:uint,expectedExitCode:uint) =
29 | let actual = DriverTool.DpInstExitCode.toDpInstExitCodeInfo dpInstExitCode
30 | Assert.AreEqual(expectedExitCode,actual.ExitCode,"Exit code was not expected");
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/DriverUpdatesTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 |
3 | open LsupEval
4 | open NUnit.Framework
5 |
6 | []
7 | []
8 | module DriverUpdatesTests=
9 | open DriverTool.Library
10 | open DriverTool.Library.DriverUpdates
11 |
12 | []
13 | let setup () =
14 | DriverTool.Library.Logging.configureConsoleLogging()
15 |
16 | []
17 | []
18 | let loadDriverUpdatesTest () =
19 | match(result{
20 | let reportProgress = DriverTool.Library.Logging.reportProgressStdOut'
21 | use cacheFolder = new DirectoryOperations.TemporaryFolder(logger)
22 | let! cacheFolderPath = cacheFolder.FolderPath
23 | let manufacturer = DriverTool.Library.ManufacturerTypes.toManufacturer "LENOVO"
24 | let! model = DriverTool.Library.ModelCode.create "20L6" false
25 | let operatingSystem = OperatingSystem.getOsNameFromOsShortName "WIN10X64"
26 | let modelName = $"20L6 %s{operatingSystem}"
27 | let! operatingSystemCode = OperatingSystemCode.create "WIN10X64" false
28 | let osBuild = "22H2"
29 | //let! excludeUpdateRegexPatterns = ([|"BIOS";"Firmware"|] |> DriverTool.Library.RegExp.toRegexPatterns true)
30 | //let! excludeUpdateRegexPatterns = ([|"BIOS"|] |> DriverTool.Library.RegExp.toRegexPatterns true)
31 | let! excludeUpdateRegexPatterns = ([||] |> DriverTool.Library.RegExp.toRegexPatterns true)
32 | let! actual = loadDriverUpdates reportProgress cacheFolderPath manufacturer model modelName operatingSystemCode osBuild excludeUpdateRegexPatterns
33 | return actual
34 | })with
35 | |Result.Ok a -> Assert.IsTrue(true)
36 | |Result.Error ex -> Assert.Fail(getAccumulatedExceptionMessages ex)
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/EnvironmentTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 |
3 | open NUnit.Framework
4 |
5 | []
6 | []
7 | module EnvironmentTests =
8 | open DriverTool
9 | open DriverTool.Library.Environment
10 |
11 | []
12 | []
13 | let unExpandEnironmentVariablesTests (unexpandedText:string, expectedUnExpandedText:string) =
14 | let expandedText =
15 | expandEnvironmentVariables unexpandedText
16 | let actual = unExpandEnironmentVariables expandedText
17 | Assert.AreEqual(expectedUnExpandedText, actual)
18 |
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/Init.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 |
3 | module Init =
4 | type ThisTestAssembly = { Empty:unit;}
5 |
6 | module TestCategory=
7 | []
8 | let UnitTests = "UnitTests"
9 | []
10 | let IntegrationTests = "IntegrationTests"
11 | []
12 | let ManualTests = "ManualTests"
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/LenovoCatalogXmlTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 |
3 | module LenovoCatalogXmlTests =
4 |
5 | open NUnit.Framework
6 |
7 | []
8 | []
9 | []
10 | []
11 | let toDateTests (stringDate, expectedDate) =
12 | let actual = DriverTool.LenovoCatalogXml.toDate (Some stringDate)
13 | match actual with
14 | |Some d ->
15 | let actualDate= (sprintf "%i%02i%02i" d.Year d.Month d.Day)
16 | Assert.AreEqual(expectedDate,actualDate)
17 | |None->
18 | Assert.Fail("Returned date was None.")
19 |
20 |
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/ModelCodeTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 | open NUnit.Framework
3 | open DriverTool.Library
4 | open System
5 |
6 | []
7 | module ModelCodeTests =
8 | []
9 | []
10 | let ModuleCodeTest() =
11 | let modelCodeResult = ModelCode.create "EQ10" false
12 | match modelCodeResult with
13 | |Ok modelCode -> Assert.IsFalse((String.IsNullOrWhiteSpace(modelCode.Value)), sprintf "Model code: %s" modelCode.Value)
14 | |Error ex -> Assert.Fail(sprintf "Did not expect to fail. Error: %s" ex.Message)
15 |
16 | []
17 | []
18 | let ModuleCodeTest_Empty_ModuleCode_UseLocalIsFalse() =
19 | let modelCodeResult = ModelCode.create "" false
20 | match modelCodeResult with
21 | |Ok modelCode -> Assert.IsFalse((String.IsNullOrWhiteSpace(modelCode.Value)), sprintf "Model code: %s" modelCode.Value)
22 | |Error ex -> Assert.IsTrue(ex.Message.EndsWith("ModelCode cannot be null or empty."))
23 |
24 | []
25 | []
26 | let ModuleCodeTest_Empty_ModuleCode_UseLocalIsTrue() =
27 | let modelCodeResult = ModelCode.create "" true
28 | match modelCodeResult with
29 | |Ok modelCode -> Assert.IsFalse((String.IsNullOrWhiteSpace(modelCode.Value)), sprintf "Model code: %s" modelCode.Value)
30 | |Error ex -> Assert.Fail(ex.Message)
31 |
32 |
33 |
34 |
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/OperatingSystemCodeTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 | open NUnit.Framework
3 | open DriverTool.Library
4 | open System
5 |
6 | []
7 | []
8 | module OperatingSystemCodeTests =
9 | []
10 | let OperatingSystemCodeTest() =
11 | let operatingSystemCodeResult = OperatingSystemCode.create "WIN10X64" false
12 | match operatingSystemCodeResult with
13 | |Ok operatingSystemCode -> Assert.IsFalse((String.IsNullOrWhiteSpace(operatingSystemCode.Value)), sprintf "Operating system code: %s" operatingSystemCode.Value)
14 | |Error ex -> Assert.Fail(sprintf "Did not expect to fail. Error: %s" ex.Message)
15 |
16 | []
17 | let OperatingSystemCodeTest_Invalid_OperatingSystemCode() =
18 | let operatingSystemCodeResult = OperatingSystemCode.create "Win1" false
19 | match operatingSystemCodeResult with
20 | |Ok os -> Assert.Fail(sprintf "Did expect to fail but did not fail.")
21 | |Error ex -> Assert.IsTrue(ex.Message.StartsWith("The operating system code 'Win1' is not valid."))
22 |
23 | []
24 | let OperatingSystemCode_Empty_OperatingSystemCode_UseLocalIsFalse() =
25 | let operatingSystemCodeResult = OperatingSystemCode.create "" false
26 | match operatingSystemCodeResult with
27 | |Ok operatingSystemCode -> Assert.IsFalse((String.IsNullOrWhiteSpace(operatingSystemCode.Value)), sprintf "Operating system code: %s" operatingSystemCode.Value)
28 | |Error ex -> Assert.IsTrue(ex.Message.EndsWith("OperatingSystemCode cannot be null or empty."))
29 |
30 | []
31 | let OperatingSystemCode_Empty_OperatingSystemCode_UseLocalIsTrue() =
32 | let operatingSystemCodeResult = OperatingSystemCode.create "" true
33 | match operatingSystemCodeResult with
34 | |Ok operatingSystemCode -> Assert.IsFalse((String.IsNullOrWhiteSpace(operatingSystemCode.Value)), sprintf "Operating system code: %s" operatingSystemCode.Value)
35 | |Error ex -> Assert.Fail(ex.Message)
36 |
37 | []
38 | let OperatingSytemCode_DifferentCase_Win10X64 () =
39 | let operatingSystemCodeResult = OperatingSystemCode.create "Win10X64" true
40 | match operatingSystemCodeResult with
41 | |Ok os -> Assert.Fail(os.Value)
42 | |Error ex -> Assert.IsTrue(true,"Expected to fail with: " + ex.Message)
43 |
44 |
45 |
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/PackageDefintionSmsTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 |
3 | open NUnit.Framework
4 |
5 | []
6 | []
7 | module PackageDefintionSmsTests=
8 | open DriverTool.Library
9 | open DriverTool.Library.PackageDefinitionSms
10 | open DriverTool.Library.PackageXml
11 | open DriverTool.Library.DriverPack
12 |
13 | []
14 | let setup () =
15 | DriverTool.Library.Logging.configureConsoleLogging()
16 |
17 | []
18 | []
19 | let writeToFileAndReadFromFileTest () =
20 | match(result{
21 | let! filePath = FileSystem.path "c:\\temp\\Example_PackageDefinition.sms"
22 | let! installProgram = createSmsProgram "INSTALL" "Install.cmd > %public%\\Logs\\Install.cmd.log" "" SmsCanRunWhen.AnyUserStatus true true false (Some SmsProgramMode.Hidden) "Install application"
23 | let! unInstallProgram = createSmsProgram "UNINSTALL" "Uninstall.cmd > %public%\\Logs\\Uninstall.cmd.log" "" SmsCanRunWhen.AnyUserStatus true true false (Some SmsProgramMode.Hidden) "Uninstall application"
24 | let manufacturerWmiQuery =
25 | {
26 | Name = "TestName"
27 | NameSpace = "TestNameSpace"
28 | Query = "TestQuery"
29 | }
30 | let modelWmiQuery =
31 | {
32 | Name = "TestName"
33 | NameSpace = "TestNameSpace"
34 | Query = "TestQuery"
35 | }
36 | let! expected = createSmsPackageDefinition "Example Application" "1.0" (Some "App.ico") "trondr" "EN" false "Example Application" [|installProgram;unInstallProgram|] manufacturerWmiQuery modelWmiQuery
37 | let! path = writeToFile logger filePath expected
38 | let! actual2 = readFromFile filePath
39 | Assert.AreEqual(expected,actual2)
40 | return actual2
41 | })with
42 | |Result.Ok a -> Assert.IsTrue(true)
43 | |Result.Error ex -> Assert.Fail(getAccumulatedExceptionMessages ex)
44 |
45 |
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/PathTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 | open NUnit.Framework
3 | open DriverTool.Library
4 |
5 | []
6 | []
7 | module PathTests =
8 | []
9 | []
10 | []
11 | []
12 | []
13 | []
14 | []
15 | let PathCreateTest (pathString:string) (description:string) (expectedSuccess:bool) =
16 | let path = FileSystem.path pathString
17 | match path with
18 | | Ok p -> Assert.IsTrue(expectedSuccess,sprintf "Success was not expected for path '%s' ('%s')" (FileSystem.pathValue p) description)
19 | | Error e -> Assert.IsTrue(not expectedSuccess,sprintf "Error was not expected for path '%s' ('%s') Exception: %s" pathString description e.Message)
20 |
21 | []
22 | []
23 | []
24 | []
25 | []
26 | []
27 | []
28 | let Path2CreateTest (pathString:string) (description:string) (expectedSuccess:bool) =
29 | let path = FileSystem.path pathString
30 | match path with
31 | | Ok p ->
32 | printfn "Path: %A" p
33 | Assert.IsTrue(expectedSuccess,sprintf "Success was not expected for path '%s' ('%s')" (FileSystem.pathValue p) description)
34 | | Error e ->
35 | printfn "Expected error: %s" e.Message
36 | Assert.IsTrue(not expectedSuccess,sprintf "Error was not expected for path '%s' ('%s') Exception: %s" pathString description e.Message)
37 |
38 | []
39 | let PathCompareTest() =
40 | let testPath = @"c:\temp\test.txt"
41 | let path1Result = FileSystem.path testPath
42 | match path1Result with
43 | | Ok path -> Assert.AreEqual(testPath, FileSystem.pathValue path)
44 | | Error ex -> Assert.Fail(sprintf "%s" ex.Message)
45 | let path2Result = FileSystem.path testPath
46 | Assert.AreEqual(path1Result,path2Result,"paths are not equal")
47 |
48 |
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/PathsTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 | open NUnit.Framework
3 | open DriverTool.Library.Paths
4 |
5 | []
6 | []
7 | module PathsTests =
8 | open System.Security.Cryptography
9 |
10 | []
11 | []
12 | []
13 | []
14 | let HasInvalidPathCharactersTests (path:string) (description:string) (expected:bool) =
15 | let actual = HasInvalidPathCharacters path
16 | Assert.AreEqual(expected,actual,description)
17 |
18 | []
19 | []
20 | []
21 | []
22 | let HasWildCardCharactersTests (path:string) (description:string) (expected:bool) =
23 | let actual = HasWildCardCharacters path
24 | Assert.AreEqual(expected,actual,description)
25 |
26 | []
27 | []
28 | []
29 | []
30 | []
31 | []
32 | let IsValidPathTests (path:string) (description:string) (expected:bool) =
33 | let actual = IsValidPath path
34 | Assert.AreEqual(expected,actual,description)
35 |
36 |
37 |
38 |
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/ProcessOperationsTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 |
3 | open NUnit.Framework
4 | open DriverTool
5 | open DriverTool.Library
6 |
7 | []
8 | []
9 | module ProcessOperationsTests =
10 | open DriverTool.Library.Logging
11 |
12 | []
13 | let startConsoleProcessTests () =
14 | let logFile= @"c:\temp\startConsoleProcess.txt"
15 | if(System.IO.File.Exists(logFile)) then
16 | System.IO.File.Delete(logFile)
17 | Assert.IsFalse(System.IO.File.Exists(logFile),"Log file exists: " + logFile)
18 |
19 | let actualResult = ProcessOperations.startConsoleProcess (FileSystem.pathUnSafe @"c:\Windows\System32\cmd.exe","/c dir *.* /s","c:\Program Files",-1,null,@"c:\temp\startConsoleProcessTest.txt",false)
20 | match actualResult with
21 | |Ok exitCode -> Assert.AreEqual(0,exitCode)
22 | |Result.Error ex -> Assert.Fail(ex.ToString())
23 |
24 | []
25 | let startConsoleProcess4Test () =
26 | configureLogging|>ignore
27 | let fileName = @"C:\WINDOWS\System32\schtasks.exe"
28 | let arguments = "/Delete /tn \"DriverTool Resume BitLocker Protection\" /f"
29 | let exitCodeResult = ProcessOperations.startConsoleProcess (FileSystem.pathUnSafe fileName,arguments,@"c:\Windows\System32",-1,null,null,false)
30 | match exitCodeResult with
31 | |Ok exitCode->Assert.AreEqual(1,exitCode,"ExitCode")
32 | |Result.Error ex->Assert.Fail(ex.Message)
33 |
34 |
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/RegExpTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 |
3 | module RegExpTests =
4 | open NUnit.Framework
5 | open DriverTool.Library
6 |
7 | []
8 | []
9 |
10 | []
11 | []
12 | []
13 | []
14 |
15 | []
16 | []
17 | []
18 |
19 | []
20 | []
21 |
22 | []
23 |
24 | let excludesTests (text:string, expected:bool, ignoreCase:bool,isSuccess:bool) =
25 | match(result
26 | {
27 | let patterns =
28 | match isSuccess with
29 | |true ->
30 | [|@"Soft\ware";@"Utility";@"B.OS";"Firmware"|]
31 | |false ->
32 | [|@"Soft\ware";@"Utility";@"B.OS";"Firmware";@"\!#%((()"|]
33 | let! regExPatterns = RegExp.toRegexPatterns ignoreCase patterns
34 | let actual = RegExp.matchAny regExPatterns text
35 | Assert.AreEqual(expected,actual,text)
36 | return actual
37 | })with
38 | |Ok _ ->
39 | Assert.IsTrue(isSuccess)
40 | |Error ex ->
41 | printf "%A" ex
42 | Assert.IsFalse(isSuccess,(sprintf "Expected success but failed with: %A" ex))
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/TestData/Cryptography/n20ku13w_x64.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/test/DriverTool.Tests/TestData/Cryptography/n20ku13w_x64.exe
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/TestData/Cryptography/n20ku13w_x64_tampered.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/test/DriverTool.Tests/TestData/Cryptography/n20ku13w_x64_tampered.exe
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/TestData/Dell/ActivityLog.xml:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/test/DriverTool.Tests/TestData/Dell/ActivityLog.xml
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/TestData/HPCatalog/HP_sp95xxx.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/test/DriverTool.Tests/TestData/HPCatalog/HP_sp95xxx.html
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/TestData/HPCatalog/HP_sp99341.html:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/test/DriverTool.Tests/TestData/HPCatalog/HP_sp99341.html
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/TestData/InstallXml/InstallXmlInstall.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | %public%\Logs
5 | MyCompany_Lenovo_ThinkPad_P50_20EQ0022MN_WIN10X64_Drivers_2019-03-20.log
6 | MyCompany Lenovo ThinkPad P50 20EQ0022MN WIN10X64 Drivers 2019-03-20
7 | 1.0
8 | 000
9 | MyCompany
10 | Lenovo
11 | 20EQ0022MN
12 | ThinkPad P50
13 | WIN10X64
14 |
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/TestData/LenovoCatalog/Update/nz3gs05w.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/test/DriverTool.Tests/TestData/LenovoCatalog/Update/nz3gs05w.exe
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/TestData/LenovoCatalog/Update/nz3gs05w.txt:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/src/test/DriverTool.Tests/TestData/LenovoCatalog/Update/nz3gs05w.txt
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/TestData/LenovoCatalog/Update/nz3gs05w_2_Empty_Corrupt.xml:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/TestData/TestDataXmlHelper.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | %public%\Logs
5 | MyCompany_Lenovo_ThinkPad_P50_20EQ0022MN_WIN10X64_Drivers_2019-03-20.log
6 | MyCompany Lenovo ThinkPad P50 20EQ0022MN WIN10X64 Drivers 2019-03-20
7 | 1.0
8 | 000
9 | MyCompany
10 | Lenovo
11 | 20EQ0022MN
12 | ThinkPad P50
13 | WIN10X64
14 |
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/UiModelsTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 |
3 | open NUnit.Framework
4 | open DriverTool.Library
5 | open DriverTool.Library.CmUi.UiModels
6 | open DriverTool.Library.Logging
7 | open DriverTool.Library.DriverPacks
8 |
9 | []
10 | []
11 | module UiModelsTests =
12 |
13 | []
14 | let setup () =
15 | DriverTool.Library.Logging.configureConsoleLogging()
16 |
17 | []
18 | let loadSccmPackagesTest () =
19 | match(result{
20 | use cacheFolder = new DirectoryOperations.TemporaryFolder(logger)
21 | let! cacheFolderPath = cacheFolder.FolderPath
22 | let! driverPackInfos = loadDriverPackInfos cacheFolderPath reportProgressStdOut'
23 | return driverPackInfos
24 | })with
25 | |Result.Ok ps -> Assert.IsTrue(ps.Length > 0, "Number of returned Sccm Packages are not greater than 0")
26 | |Result.Error ex -> Assert.Fail(ex.Message)
27 |
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/WebParsingTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 | open NUnit.Framework
3 | open System
4 | open DriverTool.Library
5 |
6 | []
7 | module WebParsingTests =
8 |
9 | open DriverTool.Library.F
10 | open System.Threading
11 | open DriverTool.Library.WebParsing
12 | open DriverTool.Library.PathOperations
13 | open DriverTool.Library.FileOperations
14 | let logger = Common.Logging.Simple.ConsoleOutLogger("WebParsingTests",Common.Logging.LogLevel.All,true,true,true,"yyyy-MM-dd-HH-mm-ss-ms")
15 |
16 | []
17 | []
18 | []
19 | []
20 | let getContentFromWebPagetest (webPageUrl:string) =
21 | let testResult =
22 | result{
23 | let! content = getContentFromWebPage webPageUrl
24 | let! filePath = FileSystem.path (getTempFile "ds112090.html")
25 | content |> (writeContentToFile logger filePath)|> ignore
26 | Assert.IsFalse(String.IsNullOrWhiteSpace(content))
27 | return content
28 | }
29 | match testResult with
30 | |Ok v -> Assert.IsTrue(true)
31 | |Error ex -> Assert.Fail(ex.Message)
32 |
33 |
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/WmiHelperTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 | open NUnit.Framework
3 |
4 | []
5 | []
6 | module WmiHelperTests =
7 | open DriverTool.Library
8 |
9 | []
10 | let WmiHelperTest_Success() =
11 | let actualResult = WmiHelper.getWmiPropertyDefault "Win32_ComputerSystem" "Name"
12 | let expected = System.Environment.GetEnvironmentVariable("COMPUTERNAME")
13 | match actualResult with
14 | |Ok actual -> Assert.AreEqual(expected,actual,"Computer name not expected.")
15 | |Error e -> Assert.Fail(e.Message)
16 |
17 | []
18 | let WmiHelperTest_InvalidClassName() =
19 | let actualResult = WmiHelper.getWmiPropertyDefault "Win32_ComputerSystem2" "Name"
20 | match actualResult with
21 | |Ok actual -> Assert.Fail("This test did not fail as expected due to invalid class name.")
22 | |Error e -> Assert.AreEqual("Failed to get wmi property for class 'Win32_ComputerSystem2' property name 'Name'",e.Message)
23 |
24 | []
25 | let WmiHelperTest_InvalidPropertyName() =
26 | let actualResult = WmiHelper.getWmiPropertyDefault "Win32_ComputerSystem" "Name2"
27 | let expected = System.Environment.GetEnvironmentVariable("COMPUTERNAME")
28 | match actualResult with
29 | |Ok actual -> Assert.Fail("This test did not fail as expected due to invalid property name.")
30 | |Error e -> Assert.AreEqual("Failed to get wmi property for class 'Win32_ComputerSystem' property name 'Name2'", e.Message)
31 |
32 | []
33 | let WmiHelper2Test_Success() =
34 | let actualResult = WmiHelper.getWmiProperty "root\WMI" "MS_SystemInformation" "BaseBoardProduct"
35 | match actualResult with
36 | |Ok actual -> Assert.IsFalse(System.String.IsNullOrWhiteSpace(actual),"Is null")
37 | |Error e ->
38 | match (e.Message.Contains("No instances of wmi class 'MS_SystemInformation' was found.")) with
39 | |true->
40 | Assert.Inconclusive()
41 | |false ->
42 | Assert.Fail(e.Message)
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/XmlToolKitTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 |
3 | open NUnit.Framework
4 |
5 | []
6 | []
7 | module XmlToolKitTests =
8 |
9 | open DriverTool.Library.XmlToolKit
10 | open System.IO
11 |
12 | []
13 | let xmlDocLoadSaveTest () =
14 | let memoryStreamToString (ms:MemoryStream) =
15 | ms.Position <- 0L
16 | use reader = new StreamReader(ms)
17 | let text = reader.ReadToEnd()
18 | text
19 | let doc =
20 | XDocument (XDeclaration "1.0" "utf-8" "yes") [
21 | XComment "Saved by DriverTool function."
22 | XElement "configuration" [
23 | XElement "Name1" ["Value1"]
24 | XElement "Name2" ["Value2"]
25 | XElement "Name3" ["Value3"]
26 | XElement "Name4" ["Value4"]
27 | ]
28 | ]
29 | let expectedXmlValue = sprintf "%s" (doc.Declaration.ToString() + System.Environment.NewLine + doc.ToString())
30 | printfn "%s" expectedXmlValue
31 | use ms = doc.Save()
32 | let actualXmlValue = memoryStreamToString ms
33 | printfn "%s" actualXmlValue
34 | Assert.AreEqual(expectedXmlValue, actualXmlValue)
35 |
36 |
--------------------------------------------------------------------------------
/src/test/DriverTool.Tests/_TemplateTests.fs:
--------------------------------------------------------------------------------
1 | namespace DriverTool.Tests
2 |
3 | open NUnit.Framework
4 |
5 | []
6 | []
7 | module _TemplateTests=
8 | open DriverTool.Library
9 |
10 | []
11 | let setup () =
12 | DriverTool.Library.Logging.configureConsoleLogging()
13 |
14 | //[]
15 | []
16 | let someTest () =
17 | match(result{
18 | let! actual = Result.Error (toException "Not Implemented" None)
19 | return actual
20 | })with
21 | |Result.Ok a -> Assert.IsTrue(true)
22 | |Result.Error ex -> Assert.Fail(getAccumulatedExceptionMessages ex)
23 |
24 |
--------------------------------------------------------------------------------
/tools/Nuget/NuGet.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/Nuget/NuGet.exe
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/FSharp.Core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/FSharp.Core.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/Jolt.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/Jolt.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/Microsoft.ApplicationInsights.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/Microsoft.ApplicationInsights.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/Microsoft.Win32.Registry.AccessControl.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/Microsoft.Win32.Registry.AccessControl.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/Microsoft.Win32.SystemEvents.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/Microsoft.Win32.SystemEvents.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/Newtonsoft.Json.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/Newtonsoft.Json.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/System.CodeDom.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/System.CodeDom.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/System.Configuration.ConfigurationManager.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/System.Configuration.ConfigurationManager.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/System.Diagnostics.EventLog.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/System.Diagnostics.EventLog.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/System.DirectoryServices.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/System.DirectoryServices.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/System.Drawing.Common.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/System.Drawing.Common.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/System.Management.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/System.Management.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/System.Security.Cryptography.Pkcs.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/System.Security.Cryptography.Pkcs.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/System.Security.Cryptography.ProtectedData.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/System.Security.Cryptography.ProtectedData.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/System.Security.Permissions.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/System.Security.Permissions.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/System.Windows.Extensions.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/System.Windows.Extensions.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/XmlDoc2CmdletDoc.Core.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/XmlDoc2CmdletDoc.Core.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/XmlDoc2CmdletDoc.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/XmlDoc2CmdletDoc.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/XmlDoc2CmdletDoc.exe:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/XmlDoc2CmdletDoc.exe
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/XmlDoc2CmdletDoc.runtimeconfig.dev.json:
--------------------------------------------------------------------------------
1 | {
2 | "runtimeOptions": {
3 | "additionalProbingPaths": [
4 | "C:\\Users\\trondr\\.dotnet\\store\\|arch|\\|tfm|",
5 | "C:\\Users\\trondr\\.nuget\\packages",
6 | "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\NuGetPackages",
7 | "C:\\Program Files (x86)\\Microsoft\\Xamarin\\NuGet",
8 | "C:\\Program Files\\dotnet\\sdk\\NuGetFallbackFolder"
9 | ]
10 | }
11 | }
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/XmlDoc2CmdletDoc.runtimeconfig.json:
--------------------------------------------------------------------------------
1 | {
2 | "runtimeOptions": {
3 | "tfm": "net5.0",
4 | "framework": {
5 | "name": "Microsoft.NETCore.App",
6 | "version": "5.0.0"
7 | }
8 | }
9 | }
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/ref/XmlDoc2CmdletDoc.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/ref/XmlDoc2CmdletDoc.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/unix/lib/net5.0/System.Management.Automation.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/unix/lib/net5.0/System.Management.Automation.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/unix/lib/netcoreapp3.0/System.Drawing.Common.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/unix/lib/netcoreapp3.0/System.Drawing.Common.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/unix/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/unix/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win-arm/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win-arm/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win-arm/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win-arm/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win-arm/native/Microsoft.Management.Infrastructure.Native.Unmanaged.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win-arm/native/Microsoft.Management.Infrastructure.Native.Unmanaged.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win-arm/native/PowerShell.Core.Instrumentation.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win-arm/native/PowerShell.Core.Instrumentation.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win-arm/native/mi.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win-arm/native/mi.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win-arm/native/miutils.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win-arm/native/miutils.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win-arm/native/pwrshplugin.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win-arm/native/pwrshplugin.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win-arm64/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win-arm64/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win-arm64/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win-arm64/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win-arm64/native/Microsoft.Management.Infrastructure.Native.Unmanaged.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win-arm64/native/Microsoft.Management.Infrastructure.Native.Unmanaged.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win-arm64/native/PowerShell.Core.Instrumentation.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win-arm64/native/PowerShell.Core.Instrumentation.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win-arm64/native/mi.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win-arm64/native/mi.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win-arm64/native/miutils.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win-arm64/native/miutils.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win-arm64/native/pwrshplugin.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win-arm64/native/pwrshplugin.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win-x64/native/PowerShell.Core.Instrumentation.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win-x64/native/PowerShell.Core.Instrumentation.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win-x64/native/pwrshplugin.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win-x64/native/pwrshplugin.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win-x86/native/PowerShell.Core.Instrumentation.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win-x86/native/PowerShell.Core.Instrumentation.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win-x86/native/pwrshplugin.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win-x86/native/pwrshplugin.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win/lib/net5.0/Microsoft.PowerShell.CoreCLR.Eventing.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win/lib/net5.0/Microsoft.PowerShell.CoreCLR.Eventing.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win/lib/net5.0/System.Management.Automation.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win/lib/net5.0/System.Management.Automation.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win/lib/netcoreapp2.0/System.Diagnostics.EventLog.Messages.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win/lib/netcoreapp2.0/System.Diagnostics.EventLog.Messages.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win/lib/netcoreapp2.0/System.Diagnostics.EventLog.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win/lib/netcoreapp2.0/System.Diagnostics.EventLog.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win/lib/netcoreapp2.0/System.DirectoryServices.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win/lib/netcoreapp2.0/System.DirectoryServices.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win/lib/netcoreapp2.0/System.Management.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win/lib/netcoreapp2.0/System.Management.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win/lib/netcoreapp3.0/Microsoft.Win32.SystemEvents.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win/lib/netcoreapp3.0/Microsoft.Win32.SystemEvents.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win/lib/netcoreapp3.0/System.Drawing.Common.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win/lib/netcoreapp3.0/System.Drawing.Common.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win/lib/netcoreapp3.0/System.Security.Cryptography.Pkcs.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win/lib/netcoreapp3.0/System.Security.Cryptography.Pkcs.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win/lib/netcoreapp3.0/System.Windows.Extensions.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win/lib/netcoreapp3.0/System.Windows.Extensions.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.AccessControl.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win/lib/netstandard2.0/Microsoft.Win32.Registry.AccessControl.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win/lib/netstandard2.0/System.Security.Cryptography.ProtectedData.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win10-x64/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win10-x64/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win10-x64/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win10-x64/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win10-x64/native/Microsoft.Management.Infrastructure.Native.Unmanaged.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win10-x64/native/Microsoft.Management.Infrastructure.Native.Unmanaged.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win10-x64/native/mi.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win10-x64/native/mi.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win10-x64/native/miutils.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win10-x64/native/miutils.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win10-x86/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win10-x86/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win10-x86/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win10-x86/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win10-x86/native/Microsoft.Management.Infrastructure.Native.Unmanaged.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win10-x86/native/Microsoft.Management.Infrastructure.Native.Unmanaged.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win10-x86/native/mi.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win10-x86/native/mi.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win10-x86/native/miutils.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win10-x86/native/miutils.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win7-x64/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win7-x64/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win7-x64/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win7-x64/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win7-x64/native/Microsoft.Management.Infrastructure.Native.Unmanaged.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win7-x64/native/Microsoft.Management.Infrastructure.Native.Unmanaged.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win7-x64/native/mi.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win7-x64/native/mi.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win7-x64/native/miutils.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win7-x64/native/miutils.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win7-x86/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win7-x86/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win7-x86/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win7-x86/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win7-x86/native/Microsoft.Management.Infrastructure.Native.Unmanaged.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win7-x86/native/Microsoft.Management.Infrastructure.Native.Unmanaged.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win7-x86/native/mi.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win7-x86/native/mi.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win7-x86/native/miutils.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win7-x86/native/miutils.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win8-x64/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win8-x64/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win8-x64/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win8-x64/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win8-x64/native/mi.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win8-x64/native/mi.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win8-x64/native/miutils.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win8-x64/native/miutils.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win8-x86/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win8-x86/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win8-x86/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win8-x86/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win8-x86/native/mi.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win8-x86/native/mi.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win8-x86/native/miutils.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win8-x86/native/miutils.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win81-x64/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win81-x64/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win81-x64/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win81-x64/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win81-x64/native/Microsoft.Management.Infrastructure.Native.Unmanaged.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win81-x64/native/Microsoft.Management.Infrastructure.Native.Unmanaged.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win81-x64/native/mi.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win81-x64/native/mi.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win81-x64/native/miutils.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win81-x64/native/miutils.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win81-x86/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win81-x86/lib/netstandard1.6/Microsoft.Management.Infrastructure.Native.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win81-x86/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win81-x86/lib/netstandard1.6/Microsoft.Management.Infrastructure.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win81-x86/native/Microsoft.Management.Infrastructure.Native.Unmanaged.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win81-x86/native/Microsoft.Management.Infrastructure.Native.Unmanaged.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win81-x86/native/mi.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win81-x86/native/mi.dll
--------------------------------------------------------------------------------
/tools/XmlDoc2CmdletDoc/runtimes/win81-x86/native/miutils.dll:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/trondr/DriverTool/68a405f574e53039c39eb18ce116f6c9df5ae9cc/tools/XmlDoc2CmdletDoc/runtimes/win81-x86/native/miutils.dll
--------------------------------------------------------------------------------