@@ -519,6 +519,11 @@ filter Copy-GitHubGist
519
519
.PARAMETER Gist
520
520
The ID of the specific gist that you wish to fork.
521
521
522
+
.PARAMETER PassThru
523
+
Returns the newly created gist fork. By default, this cmdlet does not generate any output.
524
+
You can use "Set-GitHubConfiguration -DefaultPassThru" to control the default behavior
525
+
of this switch.
526
+
522
527
.PARAMETER AccessToken
523
528
If provided, this will be used as the AccessToken for authentication with the
524
529
REST Api. Otherwise, will attempt to use the configured value or will run unauthenticated.
@@ -539,16 +544,18 @@ filter Copy-GitHubGist
539
544
Forks octocat's "hello_world.rb" gist.
540
545
541
546
.EXAMPLE
542
-
Fork-GitHubGist -Gist 6cad326836d38bd3a7ae
547
+
$result = Fork-GitHubGist -Gist 6cad326836d38bd3a7ae -PassThru
543
548
544
549
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")]
552
559
param(
553
560
[Parameter(
554
561
Mandatory,
@@ -558,6 +565,8 @@ filter Copy-GitHubGist
558
565
[ValidateNotNullOrEmpty()]
559
566
[string] $Gist,
560
567
568
+
[switch] $PassThru,
569
+
561
570
[string] $AccessToken
562
571
)
563
572
@@ -578,8 +587,13 @@ filter Copy-GitHubGist
578
587
'TelemetryProperties' = $telemetryProperties
579
588
}
580
589
581
-
return (Invoke-GHRestMethod @params |
590
+
$result = (Invoke-GHRestMethod @params |
582
591
Add-GitHubGistAdditionalProperties -TypeName $script:GitHubGistSummaryTypeName)
592
+
593
+
if (Resolve-ParameterWithDefaultConfigurationValue -Name PassThru -ConfigValueName DefaultPassThru)
594
+
{
595
+
return $result
596
+
}
583
597
}
584
598
585
599
filter Set-GitHubGistStar
@@ -1075,6 +1089,11 @@ filter Set-GitHubGist
1075
1089
.PARAMETER Force
1076
1090
If this switch is specified, you will not be prompted for confirmation of command execution.
1077
1091
1092
+
.PARAMETER PassThru
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
.PARAMETER AccessToken
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")]
1122
1142
param(
1123
1143
[Parameter(
1124
1144
Mandatory,
@@ -1136,6 +1156,8 @@ filter Set-GitHubGist
1136
1156
1137
1157
[switch] $Force,
1138
1158
1159
+
[switch] $PassThru,
1160
+
1139
1161
[string] $AccessToken
1140
1162
)
1141
1163
@@ -1231,8 +1253,13 @@ filter Set-GitHubGist
1231
1253
1232
1254
try
1233
1255
{
1234
-
return (Invoke-GHRestMethod @params |
1256
+
$result = (Invoke-GHRestMethod @params |
1235
1257
Add-GitHubGistAdditionalProperties -TypeName $script:GitHubGistTypeName)
1258
+
1259
+
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
.PARAMETER Content
1276
1303
The content of a single file that should be part of the gist.
1277
1304
1305
+
.PARAMETER PassThru
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
.PARAMETER AccessToken
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")]
1317
1350
param(
1318
1351
[Parameter(
1319
1352
Mandatory,
@@ -1345,6 +1378,8 @@ function Set-GitHubGistFile
1345
1378
[ValidateNotNullOrEmpty()]
1346
1379
[string] $Content,
1347
1380
1381
+
[switch] $PassThru,
1382
+
1348
1383
[string] $AccessToken
1349
1384
)
1350
1385
@@ -1383,6 +1418,7 @@ function Set-GitHubGistFile
1383
1418
$params = @{
1384
1419
'Gist' = $Gist
1385
1420
'Update' = $files
1421
+
'PassThru' = (Resolve-ParameterWithDefaultConfigurationValue -Name PassThru -ConfigValueName DefaultPassThru)
1386
1422
'AccessToken' = $AccessToken
1387
1423
}
1388
1424
@@ -1412,6 +1448,11 @@ function Remove-GitHubGistFile
1412
1448
.PARAMETER Force
1413
1449
If this switch is specified, you will not be prompted for confirmation of command execution.
1414
1450
1451
+
.PARAMETER PassThru
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
.PARAMETER AccessToken
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
1491
1535
'Delete' = $files
1492
1536
'Force' = $Force
1493
1537
'Confirm' = ($Confirm -eq $true)
1538
+
'PassThru' = (Resolve-ParameterWithDefaultConfigurationValue -Name PassThru -ConfigValueName DefaultPassThru)
1494
1539
'AccessToken' = $AccessToken
1495
1540
}
1496
1541
@@ -1520,6 +1565,11 @@ filter Rename-GitHubGistFile
1520
1565
.PARAMETER NewName
1521
1566
The new name of the file for the gist.
1522
1567
1568
+
.PARAMETER PassThru
1569
+
Returns the updated gist. By default, this cmdlet does not generate any output.
1570
+
You can use "Set-GitHubConfiguration -DefaultPassThru" to control the default behavior
1571
+
of this switch.
1572
+
1523
1573
.PARAMETER AccessToken
1524
1574
If provided, this will be used as the AccessToken for authentication with the
1525
1575
REST Api. Otherwise, will attempt to use the configured value or will run unauthenticated.
@@ -1544,6 +1594,7 @@ filter Rename-GitHubGistFile
1544
1594
PositionalBinding = $false)]
1545
1595
[OutputType({$script:GitHubGistTypeName})]
1546
1596
[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")]
1547
1598
param(
1548
1599
[Parameter(
1549
1600
Mandatory,
@@ -1565,6 +1616,8 @@ filter Rename-GitHubGistFile
1565
1616
[ValidateNotNullOrEmpty()]
1566
1617
[string] $NewName,
1567
1618
1619
+
[switch] $PassThru,
1620
+
1568
1621
[string] $AccessToken
1569
1622
)
1570
1623
@@ -1574,6 +1627,7 @@ filter Rename-GitHubGistFile
1574
1627
$params = @{
1575
1628
'Gist' = $Gist
1576
1629
'Update' = @{$FileName = @{ 'fileName' = $NewName }}
1630
+
'PassThru' = (Resolve-ParameterWithDefaultConfigurationValue -Name PassThru -ConfigValueName DefaultPassThru)
1577
1631
'AccessToken' = $AccessToken
1578
1632
}
1579
1633
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4