@@ -599,7 +599,7 @@ public bool InstallPackage(string packageId)
599599 {
600600 ArgsHelper . ThrowIfStringIsNullOrWhiteSpace ( packageId , "packageId" ) ;
601601
602- string cmd = string . Format ( _installCmd , packageId ) ;
602+ string cmd = ParameterHelper . AcceptPackageAgreements ( ParameterHelper . AcceptSourceAgreements ( string . Format ( _installCmd , packageId ) ) ) ;
603603
604604 ProcessResult result = Execute ( cmd ) ;
605605
@@ -627,7 +627,7 @@ public bool InstallPackage(string packageId, bool silent)
627627 {
628628 ArgsHelper . ThrowIfStringIsNullOrWhiteSpace ( packageId , "packageId" ) ;
629629
630- string cmd = string . Format ( _installCmd , packageId ) ;
630+ string cmd = ParameterHelper . AcceptPackageAgreements ( ParameterHelper . AcceptSourceAgreements ( string . Format ( _installCmd , packageId ) ) ) ;
631631
632632 if ( silent )
633633 {
@@ -720,7 +720,7 @@ public async Task<bool> InstallPackageAsync(string packageId, CancellationToken
720720 {
721721 ArgsHelper . ThrowIfStringIsNullOrWhiteSpace ( packageId , "packageId" ) ;
722722
723- string cmd = string . Format ( _installCmd , packageId ) ;
723+ string cmd = ParameterHelper . AcceptPackageAgreements ( ParameterHelper . AcceptSourceAgreements ( string . Format ( _installCmd , packageId ) ) ) ;
724724
725725 ProcessResult result = await ExecuteAsync ( cmd , false , cancellationToken ) ;
726726
@@ -752,7 +752,7 @@ public async Task<bool> InstallPackageAsync(string packageId, bool silent, Cance
752752 {
753753 ArgsHelper . ThrowIfStringIsNullOrWhiteSpace ( packageId , "packageId" ) ;
754754
755- string cmd = string . Format ( _installCmd , packageId ) ;
755+ string cmd = ParameterHelper . AcceptPackageAgreements ( ParameterHelper . AcceptSourceAgreements ( string . Format ( _installCmd , packageId ) ) ) ;
756756
757757 if ( silent )
758758 {
@@ -1153,7 +1153,7 @@ public bool UpgradePackage(string packageId)
11531153 {
11541154 ArgsHelper . ThrowIfStringIsNullOrWhiteSpace ( packageId , "packageId" ) ;
11551155
1156- string cmd = ParameterHelper . AcceptSourceAgreements ( string . Format ( _upgradeCmd , packageId ) ) ;
1156+ string cmd = ParameterHelper . AcceptPackageAgreements ( ParameterHelper . AcceptSourceAgreements ( string . Format ( _upgradeCmd , packageId ) ) ) ;
11571157
11581158 ProcessResult result = Execute ( cmd ) ;
11591159
@@ -1181,7 +1181,7 @@ public bool UpgradePackage(string packageId, bool silent)
11811181 {
11821182 ArgsHelper . ThrowIfStringIsNullOrWhiteSpace ( packageId , "packageId" ) ;
11831183
1184- string cmd = ParameterHelper . AcceptSourceAgreements ( string . Format ( _upgradeCmd , packageId ) ) ;
1184+ string cmd = ParameterHelper . AcceptPackageAgreements ( ParameterHelper . AcceptSourceAgreements ( string . Format ( _upgradeCmd , packageId ) ) ) ;
11851185
11861186 if ( silent )
11871187 {
@@ -1274,7 +1274,7 @@ public async Task<bool> UpgradePackageAsync(string packageId, CancellationToken
12741274 {
12751275 ArgsHelper . ThrowIfStringIsNullOrWhiteSpace ( packageId , "packageId" ) ;
12761276
1277- string cmd = ParameterHelper . AcceptSourceAgreements ( string . Format ( _upgradeCmd , packageId ) ) ;
1277+ string cmd = ParameterHelper . AcceptPackageAgreements ( ParameterHelper . AcceptSourceAgreements ( string . Format ( _upgradeCmd , packageId ) ) ) ;
12781278
12791279 ProcessResult result = await ExecuteAsync ( cmd , false , cancellationToken ) ;
12801280
@@ -1306,7 +1306,7 @@ public async Task<bool> UpgradePackageAsync(string packageId, bool silent, Cance
13061306 {
13071307 ArgsHelper . ThrowIfStringIsNullOrWhiteSpace ( packageId , "packageId" ) ;
13081308
1309- string cmd = ParameterHelper . AcceptSourceAgreements ( string . Format ( _upgradeCmd , packageId ) ) ;
1309+ string cmd = ParameterHelper . AcceptPackageAgreements ( ParameterHelper . AcceptSourceAgreements ( string . Format ( _upgradeCmd , packageId ) ) ) ;
13101310
13111311 if ( silent )
13121312 {
@@ -1397,7 +1397,7 @@ public async Task<bool> UpgradePackageAsync(WinGetPackage package, bool silent,
13971397 /// </exception>
13981398 public bool UpgradeAllPackages ( )
13991399 {
1400- ProcessResult result = Execute ( ParameterHelper . AcceptSourceAgreements ( _upgradeAllCmd ) ) ;
1400+ ProcessResult result = Execute ( ParameterHelper . AcceptPackageAgreements ( ParameterHelper . AcceptSourceAgreements ( _upgradeAllCmd ) ) ) ;
14011401
14021402 return result . Success ;
14031403 }
@@ -1417,7 +1417,7 @@ public bool UpgradeAllPackages()
14171417 /// </exception>
14181418 public bool UpgradeAllPackages ( bool silent )
14191419 {
1420- string cmd = ParameterHelper . AcceptSourceAgreements ( _upgradeAllCmd ) ;
1420+ string cmd = ParameterHelper . AcceptPackageAgreements ( ParameterHelper . AcceptSourceAgreements ( _upgradeAllCmd ) ) ;
14211421 if ( silent )
14221422 {
14231423 cmd = ParameterHelper . Silent ( cmd ) ;
@@ -1446,7 +1446,7 @@ public bool UpgradeAllPackages(bool silent)
14461446 /// </exception>
14471447 public async Task < bool > UpgradeAllPackagesAsync ( CancellationToken cancellationToken = default )
14481448 {
1449- ProcessResult result = await ExecuteAsync ( ParameterHelper . AcceptSourceAgreements ( _upgradeAllCmd ) , false , cancellationToken ) ;
1449+ ProcessResult result = await ExecuteAsync ( ParameterHelper . AcceptPackageAgreements ( ParameterHelper . AcceptSourceAgreements ( _upgradeAllCmd ) ) , false , cancellationToken ) ;
14501450
14511451 return result . Success ;
14521452 }
@@ -1470,7 +1470,7 @@ public async Task<bool> UpgradeAllPackagesAsync(CancellationToken cancellationTo
14701470 /// </exception>
14711471 public async Task < bool > UpgradeAllPackagesAsync ( bool silent , CancellationToken cancellationToken = default )
14721472 {
1473- string cmd = ParameterHelper . AcceptSourceAgreements ( _upgradeAllCmd ) ;
1473+ string cmd = ParameterHelper . AcceptPackageAgreements ( ParameterHelper . AcceptSourceAgreements ( _upgradeAllCmd ) ) ;
14741474 if ( silent )
14751475 {
14761476 cmd = ParameterHelper . Silent ( cmd ) ;
@@ -1512,7 +1512,7 @@ public bool RepairPackage(string packageId)
15121512
15131513 ArgsHelper . ThrowIfStringIsNullOrWhiteSpace ( packageId , "packageId" ) ;
15141514
1515- string cmd = string . Format ( _repairCmd , packageId ) ;
1515+ string cmd = ParameterHelper . AcceptPackageAgreements ( ParameterHelper . AcceptSourceAgreements ( string . Format ( _repairCmd , packageId ) ) ) ;
15161516
15171517 ProcessResult result = Execute ( cmd ) ;
15181518
@@ -1549,7 +1549,7 @@ public bool RepairPackage(string packageId, bool silent)
15491549
15501550 ArgsHelper . ThrowIfStringIsNullOrWhiteSpace ( packageId , "packageId" ) ;
15511551
1552- string cmd = string . Format ( _repairCmd , packageId ) ;
1552+ string cmd = ParameterHelper . AcceptPackageAgreements ( ParameterHelper . AcceptSourceAgreements ( string . Format ( _repairCmd , packageId ) ) ) ;
15531553
15541554 if ( silent )
15551555 {
@@ -1659,7 +1659,7 @@ public async Task<bool> RepairPackageAsync(string packageId, CancellationToken c
16591659
16601660 ArgsHelper . ThrowIfStringIsNullOrWhiteSpace ( packageId , "packageId" ) ;
16611661
1662- string cmd = string . Format ( _repairCmd , packageId ) ;
1662+ string cmd = ParameterHelper . AcceptPackageAgreements ( ParameterHelper . AcceptSourceAgreements ( string . Format ( _repairCmd , packageId ) ) ) ;
16631663
16641664 ProcessResult result = await ExecuteAsync ( cmd , false , cancellationToken ) ;
16651665
@@ -1700,7 +1700,7 @@ public async Task<bool> RepairPackageAsync(string packageId, bool silent, Cancel
17001700
17011701 ArgsHelper . ThrowIfStringIsNullOrWhiteSpace ( packageId , "packageId" ) ;
17021702
1703- string cmd = string . Format ( _repairCmd , packageId ) ;
1703+ string cmd = ParameterHelper . AcceptPackageAgreements ( ParameterHelper . AcceptSourceAgreements ( string . Format ( _repairCmd , packageId ) ) ) ;
17041704
17051705 if ( silent )
17061706 {
@@ -2115,7 +2115,9 @@ public bool Download(string packageId, string directory)
21152115 ArgsHelper . ThrowIfStringIsNullOrWhiteSpace ( packageId , "packageId" ) ;
21162116 ArgsHelper . ThrowIfStringIsNullOrWhiteSpace ( directory , "directory" ) ;
21172117
2118- string cmd = string . Format ( ParameterHelper . AcceptSourceAgreements ( _downloadCmd ) , packageId , directory ) ;
2118+ string cmd = string . Format (
2119+ ParameterHelper . AcceptPackageAgreements ( ParameterHelper . AcceptSourceAgreements ( _downloadCmd ) ) ,
2120+ packageId , directory ) ;
21192121
21202122 ProcessResult result = Execute ( cmd ) ;
21212123
@@ -2254,7 +2256,9 @@ public async Task<bool> DownloadAsync(string packageId, string directory, Cancel
22542256 ArgsHelper . ThrowIfStringIsNullOrWhiteSpace ( packageId , "packageId" ) ;
22552257 ArgsHelper . ThrowIfStringIsNullOrWhiteSpace ( directory , "directory" ) ;
22562258
2257- string cmd = string . Format ( ParameterHelper . AcceptSourceAgreements ( _downloadCmd ) , packageId , directory ) ;
2259+ string cmd = string . Format (
2260+ ParameterHelper . AcceptPackageAgreements ( ParameterHelper . AcceptSourceAgreements ( _downloadCmd ) ) ,
2261+ packageId , directory ) ;
22582262
22592263 ProcessResult result = await ExecuteAsync ( cmd , false , cancellationToken ) ;
22602264
0 commit comments