Marco Blessing
e22fb0ae06
All checks were successful
continuous-integration/drone/push Build is passing
#### 📖 Summary - updated cmdlet logix - added PsdKit as exernal helper - added PsdKit module as dependency - add `-Path` parameter #### 📑 Test Plan > 💡 Select your test plan for the code changes. - [x] Tested via Drone.io pipeline - [ ] Custom test - [ ] No test plan ##### Details / Justification <!-- Add your test details or justification for missing tests here. --> #### 📚 Additional Notes - fixes #6 Co-authored-by: OCram85 <marco.blessing@googlemail.com> Reviewed-on: #7
79 lines
2.7 KiB
PowerShell
79 lines
2.7 KiB
PowerShell
function Invoke-FixDevDependency {
|
|
<#
|
|
.SYNOPSIS
|
|
Installs dev dependencies.
|
|
|
|
.DESCRIPTION
|
|
Invoke-FixDevDependency acts as workaround to load the dependencies needed to load the pwsh module.
|
|
This is just standalone version of the embedded `Invoke-InstallDependency` which can't be called
|
|
by the DroneHelper build pipeline itself.
|
|
#>
|
|
|
|
[CmdletBinding()]
|
|
param ()
|
|
|
|
process {
|
|
try {
|
|
$PSScriptParams = @{
|
|
Name = 'PSScriptAnalyzer'
|
|
Scope = 'CurrentUser'
|
|
RequiredVersion = '1.20.0'
|
|
Force = $true
|
|
SkipPublisherCheck = $true
|
|
AllowClobber = $true
|
|
Verbose = $VerbosePreference
|
|
ErrorAction = 'Stop'
|
|
}
|
|
Install-Module @PSScriptParams
|
|
|
|
$PesterParams = @{
|
|
Name = 'Pester'
|
|
Scope = 'CurrentUser'
|
|
RequiredVersion = '5.3.1'
|
|
Force = $true
|
|
SkipPublisherCheck = $true
|
|
AllowClobber = $true
|
|
Verbose = $VerbosePreference
|
|
ErrorAction = 'Stop'
|
|
}
|
|
Install-Module @PesterParams
|
|
|
|
$PoshParams = @{
|
|
Name = 'posh-git'
|
|
Scope = 'CurrentUser'
|
|
RequiredVersion = '1.1.0'
|
|
Force = $true
|
|
SkipPublisherCheck = $true
|
|
AllowClobber = $true
|
|
Verbose = $VerbosePreference
|
|
ErrorAction = 'Stop'
|
|
}
|
|
Install-Module @PoshParams
|
|
|
|
|
|
$PsdKitParams = @{
|
|
Name = 'PsdKit'
|
|
Scope = 'CurrentUser'
|
|
RequiredVersion = '0.6.2'
|
|
Force = $true
|
|
SkipPublisherCheck = $true
|
|
AllowClobber = $true
|
|
AllowPrerelease = $true
|
|
Verbose = $VerbosePreference
|
|
ErrorAction = 'Stop'
|
|
}
|
|
Install-Module @PsdKitParams
|
|
}
|
|
catch {
|
|
$ExecParams = @{
|
|
Exception = [System.Exception]::new(
|
|
'Could not install required build dependencies!',
|
|
$PSItem.Exception
|
|
)
|
|
ErrorAction = 'Stop'
|
|
}
|
|
Write-Error @ExecParams
|
|
}
|
|
}
|
|
}
|