Skip to content

Commit

Permalink
Merge pull request #24 from bateskevin/master
Browse files Browse the repository at this point in the history
Added proxy parameter to Install-CUDiagramPrerequisites
  • Loading branch information
Stephanevg committed Oct 4, 2018
2 parents 5f1b338 + e86c524 commit ba9985d
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 6 deletions.
31 changes: 25 additions & 6 deletions Functions/Public/Install-CUDiagramPrerequisites.ps1
Original file line number Diff line number Diff line change
@@ -1,20 +1,39 @@
function Install-CUDiagramPrerequisites {
<#
.SYNOPSIS
This function installs the prerequisites for PSClassUtils.
.DESCRIPTION
Installation of PSGraph
.EXAMPLE
Istall-CUDiagramPrerequisites
.EXAMPLE
Istall-CUDiagramPrerequisites -proxy "10.10.10.10"
.NOTES
Author: Stephanevg
Version: 2.0
#>

[CmdletBinding()]
param (

[String]$Proxy
)

if(!(Get-Module -Name PSGraph)){
#Module is not loaded
if(!(get-module -listavailable -name psgraph )){
write-verbose "Install PSGraph"
Install-Module psgraph -Verbose
Import-Module psgraph -Force

if($proxy){
write-verbose "Install PSGraph"
Install-Module psgraph -Verbose -proxy $proxy
Import-Module psgraph -Force
}else{
write-verbose "Install PSGraph"
Install-Module psgraph -Verbose
Import-Module psgraph -Force
}
}else{
Import-Module psgraph -Force
}

Install-GraphViz
}
}
}
12 changes: 12 additions & 0 deletions Tests/ClassUtils.Install-CUDiagramPrerequisites.Tests.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
Import-Module -Force $PSScriptRoot\..\PSClassUtils.psm1

InModuleScope PSClassUtils -ScriptBlock {

Describe "Testing Function: 'Install-CUDiagramPrerequisites'" {
it '[Function][Parameter] The proxy parameter should be available.' {

(Get-Command Install-CUDiagramPrerequisites).Parameters.keys -contains "proxy"

}
}
}

0 comments on commit ba9985d

Please sign in to comment.