Skip to content

Commit

Permalink
Update install-fusion-ps.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
HansDahle authored Aug 14, 2024
1 parent e15a6ea commit 5228a01
Showing 1 changed file with 19 additions and 25 deletions.
44 changes: 19 additions & 25 deletions pipelines/templates/install-fusion-ps.yml
Original file line number Diff line number Diff line change
@@ -1,30 +1,24 @@
steps:
- task: AzurePowershell@4
displayName: 'Install Fusion PS Modules'
inputs:
azureSubscription: $(subscriptionService)
ScriptType: 'InlineScript'
FailOnStandardError: true
azurePowerShellVersion: 'LatestVersion'
Inline: |
Write-Host "Registering Fusion PowerShell Repository"
- powershell: |
Write-Host "Registering Fusion PowerShell Repository"
if ($null -eq (Get-PSRepository -Name Fusion -ErrorAction SilentlyContinue)) {
Register-PSRepository -Name Fusion -SourceLocation "https://statoil-proview.pkgs.visualstudio.com/5309109e-a734-4064-a84c-fbce45336913/_packaging/Fusion-Public/nuget/v2" -InstallationPolicy Trusted -ErrorAction Stop
Write-Host "Ok"
} else {
Write-Host "Fusion already added as a repository..."
}
if ($null -eq (Get-PSRepository -Name Fusion -ErrorAction SilentlyContinue)) {
Register-PSRepository -Name Fusion -SourceLocation "https://statoil-proview.pkgs.visualstudio.com/5309109e-a734-4064-a84c-fbce45336913/_packaging/Fusion-Public/nuget/v2" -InstallationPolicy Trusted -ErrorAction Stop
Write-Host "Ok"
} else {
Write-Host "Fusion already added as a repository..."
}
Write-Host "Installing FusionPS module for CurrentUser"
Install-Module FusionPS -Repository Fusion -Force -Scope CurrentUser
Write-Host "Installing FusionPS module for CurrentUser"
Install-Module FusionPS -Repository Fusion -Force -Scope CurrentUser
Write-Output (Get-Module -ListAvailable -Name FusionPS)
Write-Output (Get-Module -ListAvailable -Name FusionPS)
## Remove repository
if ($null -ne (Get-PSRepository -Name Fusion -ErrorAction SilentlyContinue)) {
Unregister-PSRepository -Name Fusion -ErrorAction Stop
Write-Host "Ok"
} else {
Write-Host "Was not able to remove the fusion ps repo... This can cause problems on hosted agents."
}
## Remove repository
if ($null -ne (Get-PSRepository -Name Fusion -ErrorAction SilentlyContinue)) {
Unregister-PSRepository -Name Fusion -ErrorAction Stop
Write-Host "Ok"
} else {
Write-Host "Was not able to remove the fusion ps repo... This can cause problems on hosted agents."
}
displayName: 'Install Fusion PS Modules'

0 comments on commit 5228a01

Please sign in to comment.