From c1e181ea1152453527f73971c93921487c046146 Mon Sep 17 00:00:00 2001 From: LucD Date: Mon, 18 Nov 2019 13:34:04 +0100 Subject: [PATCH] On the off chance someone does not have PowerCLI installed Handle ToString() error when PCLI is not present Signed-off-by: Luc Dekens --- Scripts/At_Your_Fingertips/NewProfile.ps1 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Scripts/At_Your_Fingertips/NewProfile.ps1 b/Scripts/At_Your_Fingertips/NewProfile.ps1 index a4b9f8d..66ea5aa 100644 --- a/Scripts/At_Your_Fingertips/NewProfile.ps1 +++ b/Scripts/At_Your_Fingertips/NewProfile.ps1 @@ -89,7 +89,7 @@ function Set-Title $pcliModule = Get-Module -Name VMware.PowerCLI -ListAvailable | Sort-Object -Property Version -Descending | Select-Object -First 1 - $pcli = " - PCLI: $($pcliModule.Version.ToString())" + $pcli = " - PCLI: $(if($pcliModule){$pcliModule.Version.ToString()}else{'na'})" # If git is present and if in a git controlled folder, display repositoryname/current_branch $gitStr = ''