File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed
DSCResources/cChocoPackageInstall Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -501,6 +501,11 @@ function Get-ChocoInstalledPackage {
501501 [switch ]$NoCache
502502 )
503503
504+ if ([string ]::IsNullOrEmpty($env: ChocolateyInstall ))
505+ {
506+ $env: ChocolateyInstall = [environment ]::GetEnvironmentVariable(' ChocolateyInstall' , ' Machine' )
507+ }
508+
504509 $ChocoInstallLP = Join-Path - Path $env: ChocolateyInstall - ChildPath ' cache'
505510 if ( -not (Test-Path $ChocoInstallLP )){
506511 New-Item - Name ' cache' - Path $env: ChocolateyInstall - ItemType Directory | Out-Null
@@ -532,6 +537,12 @@ function Get-ChocoVersion {
532537 [switch ]$Purge ,
533538 [switch ]$NoCache
534539 )
540+
541+ if ([string ]::IsNullOrEmpty($env: ChocolateyInstall ))
542+ {
543+ $env: ChocolateyInstall = [environment ]::GetEnvironmentVariable(' ChocolateyInstall' , ' Machine' )
544+ }
545+
535546 $chocoInstallCache = Join-Path - Path $env: ChocolateyInstall - ChildPath ' cache'
536547 if ( -not (Test-Path $chocoInstallCache )){
537548 New-Item - Name ' cache' - Path $env: ChocolateyInstall - ItemType Directory | Out-Null
You can’t perform that action at this time.
0 commit comments