From bcb923281d39709ca8cdba2de0eb439d6ce496d8 Mon Sep 17 00:00:00 2001 From: Xavier Vallve Date: Wed, 13 Sep 2017 14:40:10 +0200 Subject: [PATCH] Assign pscredendialts correctly Proposed solution for https://github.com/bottkars/NWPSRestToolKit/issues/2 --- NWPSRestToolKit.psm1 | 1 + 1 file changed, 1 insertion(+) diff --git a/NWPSRestToolKit.psm1 b/NWPSRestToolKit.psm1 index 028adbf..fcecd0c 100644 --- a/NWPSRestToolKit.psm1 +++ b/NWPSRestToolKit.psm1 @@ -32,6 +32,7 @@ $SecurePassword = Read-Host -Prompt "Enter Networker Password for user $user" -AsSecureString $Global:NWCredentials = New-Object System.Management.Automation.PSCredential (“$user”,$Securepassword) } + else { $Global:NWCredentials = $Credentials } $Global:NWbaseurl = "https://$($NWIP):$($NWPort)/nwrestapi/v1" } End