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 {
501
501
[switch ]$NoCache
502
502
)
503
503
504
+ if ([string ]::IsNullOrEmpty($env: ChocolateyInstall ))
505
+ {
506
+ $env: ChocolateyInstall = [environment ]::GetEnvironmentVariable(' ChocolateyInstall' , ' Machine' )
507
+ }
508
+
504
509
$ChocoInstallLP = Join-Path - Path $env: ChocolateyInstall - ChildPath ' cache'
505
510
if ( -not (Test-Path $ChocoInstallLP )){
506
511
New-Item - Name ' cache' - Path $env: ChocolateyInstall - ItemType Directory | Out-Null
@@ -532,6 +537,12 @@ function Get-ChocoVersion {
532
537
[switch ]$Purge ,
533
538
[switch ]$NoCache
534
539
)
540
+
541
+ if ([string ]::IsNullOrEmpty($env: ChocolateyInstall ))
542
+ {
543
+ $env: ChocolateyInstall = [environment ]::GetEnvironmentVariable(' ChocolateyInstall' , ' Machine' )
544
+ }
545
+
535
546
$chocoInstallCache = Join-Path - Path $env: ChocolateyInstall - ChildPath ' cache'
536
547
if ( -not (Test-Path $chocoInstallCache )){
537
548
New-Item - Name ' cache' - Path $env: ChocolateyInstall - ItemType Directory | Out-Null
You can’t perform that action at this time.
0 commit comments