Skip to content

Commit

Permalink
-Remove unnecessary functions
Browse files Browse the repository at this point in the history
-Fixed a bug wherein PowerShell unit tests would fail when root solution folder not named "PrtgAPI"
  • Loading branch information
lordmilko committed Mar 5, 2017
1 parent a25c8f1 commit 0aa87f6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 17 deletions.
4 changes: 2 additions & 2 deletions PrtgAPI.Tests.UnitTests/PowerShell/Support/Init.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ function ImportModules($scriptRoot)
{
# Get Root Folder

$root = "\PrtgAPI\"
$rootIndex = $scriptRoot.ToLower().IndexOf($root.ToLower()) + $root.Length
$root = "PrtgAPI.Tests.UnitTests"
$rootIndex = $scriptRoot.ToLower().IndexOf($root.ToLower())
$rootFolder = $scriptRoot.Substring(0, $rootIndex)

# Get Test Folder
Expand Down
17 changes: 2 additions & 15 deletions PrtgAPI/PowerShell/Resources/PrtgAPI.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function New-Credential
New-Object System.Management.Automation.PSCredential -ArgumentList $UserName, $secureString
}

function Install-PrtgAPI
<#function Install-PrtgAPI
{
[CmdletBinding()]
Param()
Expand Down Expand Up @@ -119,19 +119,6 @@ function Update-PrtgAPI
$script = ([ScriptBlock]::Create($updateFunction))
powershell.exe -noexit -command $script

<#
function f
{
Write-Host 'uh oh'
}
$fooDef = "function foo { $((get-command f).Definition) }; foo"
. ([ScriptBlock]::Create($fooDef))
f
#>
}
else
{
Expand All @@ -142,6 +129,6 @@ function Update-PrtgAPI
{
Write-Host "Could not update PrtgAPI; last build was unsuccessful. Please see https://github.com/lordmilko/PrtgAPI to update manually."
}
}
}#>

#todo: maybe have a list of exported commands, and have a version on this file in the output of get-module

0 comments on commit 0aa87f6

Please sign in to comment.