-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from bateskevin/master
Added proxy parameter to Install-CUDiagramPrerequisites
- Loading branch information
Showing
2 changed files
with
37 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | ||
|
||
} | ||
} | ||
} |