Delete commit history (containing proprietary code)
Some checks reported errors
continuous-integration/drone/push Build was killed
Some checks reported errors
continuous-integration/drone/push Build was killed
This commit is contained in:
48
scripts/ADCS/Install-Prerequisites.ps1
Normal file
48
scripts/ADCS/Install-Prerequisites.ps1
Normal file
@ -0,0 +1,48 @@
|
||||
[CmdletBinding()]
|
||||
Param(
|
||||
# No parameters
|
||||
)
|
||||
|
||||
$InstallWindowsFeatureSplat = @{
|
||||
Name = 'Adcs-Cert-Authority'
|
||||
IncludeAllSubFeature = $True
|
||||
IncludeManagementTools = $True
|
||||
Restart = $False
|
||||
Confirm = $False
|
||||
}
|
||||
Install-WindowsFeature @InstallWindowsFeatureSplat
|
||||
|
||||
$InstallPackageProviderSplat = @{
|
||||
Name = 'NuGet'
|
||||
MinimumVersion = '2.8.5.201'
|
||||
Force = $True
|
||||
Confirm = $False
|
||||
}
|
||||
Install-PackageProvider @InstallPackageProviderSplat
|
||||
$SetPSRepositorySplat = @{
|
||||
Name = 'PSGallery'
|
||||
InstallationPolicy = 'Trusted'
|
||||
}
|
||||
Set-PSRepository @SetPSRepositorySplat
|
||||
$InstallModuleSplat = @{
|
||||
Name = 'powershell-yaml'
|
||||
Force = $True
|
||||
Confirm = $False
|
||||
}
|
||||
Install-Module @InstallModuleSplat
|
||||
$SetPSRepositorySplat = @{
|
||||
Name = 'PSGallery'
|
||||
InstallationPolicy = 'Untrusted'
|
||||
}
|
||||
Set-PSRepository @SetPSRepositorySplat
|
||||
|
||||
# Double check whether the required PowerShell modules are available
|
||||
$RequiredModules = @(
|
||||
'powershell-yaml' # Provides cmdlets 'ConvertTo-Yaml' and 'ConvertFrom-Yaml'
|
||||
)
|
||||
ForEach ($Module in $RequiredModules) {
|
||||
If ([boolean](Get-Module -Name $Module -ListAvailable) -ne $True) {
|
||||
Write-Error -Message "Missing PowerShell module '$($Module)'"
|
||||
Exit 1
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user