You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updates all state-changing commands to be silent by default (with -PassThru) (#276)
All state-changing commands (with the exception of `New-*`) are now silent by default. Users can pass-in `-PassThru` to make them return the result that used to be returned by default.
Users can revert back to the previous behavior by leveraging the new configuration value: `DefaultPassThru`.
Resolves#217
Updates the body of the comment with ID 1232456 octocat's "hello_world.rb" gist to be
336
341
"Hello World".
@@ -339,6 +344,7 @@ filter Set-GitHubGistComment
339
344
SupportsShouldProcess,
340
345
PositionalBinding=$false)]
341
346
[OutputType({$script:GitHubGistCommentTypeName})]
347
+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter","", Justification="PassThru is accessed indirectly via Resolve-ParameterWithDefaultConfigurationValue")]
Forks octocat's "hello_world.rb" gist. This is using the alias for the command.
545
550
The result is the same whether you use Copy-GitHubGist or Fork-GitHubGist.
551
+
Specifying the -PassThru switch enables you to get a reference to the newly created fork.
546
552
#>
547
553
[CmdletBinding(
548
554
SupportsShouldProcess,
549
555
PositionalBinding=$false)]
550
556
[OutputType({$script:GitHubGistSummaryTypeName})]
551
557
[Alias('Fork-GitHubGist')]
558
+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter","", Justification="PassThru is accessed indirectly via Resolve-ParameterWithDefaultConfigurationValue")]
if (Resolve-ParameterWithDefaultConfigurationValue-Name PassThru -ConfigValueName DefaultPassThru)
594
+
{
595
+
return$result
596
+
}
583
597
}
584
598
585
599
filterSet-GitHubGistStar
@@ -1075,6 +1089,11 @@ filter Set-GitHubGist
1075
1089
.PARAMETERForce
1076
1090
If this switch is specified, you will not be prompted for confirmation of command execution.
1077
1091
1092
+
.PARAMETERPassThru
1093
+
Returns the updated gist. By default, this cmdlet does not generate any output.
1094
+
You can use "Set-GitHubConfiguration -DefaultPassThru" to control the default behavior
1095
+
of this switch.
1096
+
1078
1097
.PARAMETERAccessToken
1079
1098
If provided, this will be used as the AccessToken for authentication with the
1080
1099
REST Api. Otherwise, will attempt to use the configured value or will run unauthenticated.
@@ -1119,6 +1138,7 @@ filter Set-GitHubGist
1119
1138
DefaultParameterSetName='Content',
1120
1139
PositionalBinding=$false)]
1121
1140
[OutputType({$script:GitHubGistTypeName})]
1141
+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter","", Justification="PassThru is accessed indirectly via Resolve-ParameterWithDefaultConfigurationValue")]
if (Resolve-ParameterWithDefaultConfigurationValue-Name PassThru -ConfigValueName DefaultPassThru)
1260
+
{
1261
+
return$result
1262
+
}
1236
1263
}
1237
1264
catch
1238
1265
{
@@ -1275,6 +1302,11 @@ function Set-GitHubGistFile
1275
1302
.PARAMETERContent
1276
1303
The content of a single file that should be part of the gist.
1277
1304
1305
+
.PARAMETERPassThru
1306
+
Returns the updated gist. By default, this cmdlet does not generate any output.
1307
+
You can use "Set-GitHubConfiguration -DefaultPassThru" to control the default behavior
1308
+
of this switch.
1309
+
1278
1310
.PARAMETERAccessToken
1279
1311
If provided, this will be used as the AccessToken for authentication with the
1280
1312
REST Api. Otherwise, will attempt to use the configured value or will run unauthenticated.
@@ -1314,6 +1346,7 @@ function Set-GitHubGistFile
1314
1346
[OutputType({$script:GitHubGistTypeName})]
1315
1347
[Alias('Add-GitHubGistFile')]
1316
1348
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess","", Justification="This is a helper method for Set-GitHubGist which will handle ShouldProcess.")]
1349
+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter","", Justification="PassThru is accessed indirectly via Resolve-ParameterWithDefaultConfigurationValue")]
@@ -1412,6 +1448,11 @@ function Remove-GitHubGistFile
1412
1448
.PARAMETERForce
1413
1449
If this switch is specified, you will not be prompted for confirmation of command execution.
1414
1450
1451
+
.PARAMETERPassThru
1452
+
Returns the updated gist. By default, this cmdlet does not generate any output.
1453
+
You can use "Set-GitHubConfiguration -DefaultPassThru" to control the default behavior
1454
+
of this switch.
1455
+
1415
1456
.PARAMETERAccessToken
1416
1457
If provided, this will be used as the AccessToken for authentication with the
1417
1458
REST Api. Otherwise, will attempt to use the configured value or will run unauthenticated.
@@ -1447,6 +1488,7 @@ function Remove-GitHubGistFile
1447
1488
[OutputType({$script:GitHubGistTypeName})]
1448
1489
[Alias('Delete-GitHubGistFile')]
1449
1490
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess","", Justification="This is a helper method for Set-GitHubGist which will handle ShouldProcess.")]
1491
+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter","", Justification="PassThru is accessed indirectly via Resolve-ParameterWithDefaultConfigurationValue")]
1450
1492
param(
1451
1493
[Parameter(
1452
1494
Mandatory,
@@ -1465,6 +1507,8 @@ function Remove-GitHubGistFile
1465
1507
1466
1508
[switch] $Force,
1467
1509
1510
+
[switch] $PassThru,
1511
+
1468
1512
[string] $AccessToken
1469
1513
)
1470
1514
@@ -1491,6 +1535,7 @@ function Remove-GitHubGistFile
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSShouldProcess","", Justification="This is a helper method for Set-GitHubGist which will handle ShouldProcess.")]
1597
+
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSReviewUnusedParameter","", Justification="PassThru is accessed indirectly via Resolve-ParameterWithDefaultConfigurationValue")]
0 commit comments