From 6c5705ee7699ff8fd09d1ce2100c57f5174f680e Mon Sep 17 00:00:00 2001 From: lukemgriffith Date: Mon, 10 Jul 2017 21:43:32 +0100 Subject: [PATCH] Moved to using reduced output. --- .../cChocoPackageInstall/cChocoPackageInstall.psm1 | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/DSCResources/cChocoPackageInstall/cChocoPackageInstall.psm1 b/DSCResources/cChocoPackageInstall/cChocoPackageInstall.psm1 index 2502a4c..28756ae 100644 --- a/DSCResources/cChocoPackageInstall/cChocoPackageInstall.psm1 +++ b/DSCResources/cChocoPackageInstall/cChocoPackageInstall.psm1 @@ -381,14 +381,7 @@ Function Upgrade-Package { } function Get-ChocoInstalledPackage { - $res = choco list -lo | ForEach-Object { - $Obj = $_ -split '\s' - [pscustomobject]@{ - 'Name' = $Obj[0] - 'Version' = $Obj[1] - } - } - Return $res + Return (choco list -lo -r | ConvertFrom-Csv -Header 'Name', 'Version' -Delimiter "|") } Export-ModuleMember -Function *-TargetResource \ No newline at end of file