Skip to content

Commit 5b9701c

Browse files
TimHessCopilot
andcommitted
Apply suggestions from code review
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent b136fc3 commit 5b9701c

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

FileShares/scripts/cf-create-service.ps1

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22

33
Param(
44
[Parameter(Mandatory = $true, HelpMessage = "UNC path to the network share. For example: '\\localhost\steeltoe_network_share'")][string]$NetworkAddress,
5-
[Parameter(Mandatory=$true)][string]$UserName,
6-
[Parameter(Mandatory=$true)][string]$Password,
5+
[Parameter(Mandatory=$true)][string]$UserName,
6+
[Parameter(Mandatory=$true)][string]$Password,
77
[string]$ServiceName = "credhub",
88
[string]$ServicePlan = "default",
99
[string]$ServiceInstanceName = "sampleNetworkShare"
@@ -19,6 +19,10 @@ $params = @{
1919
}
2020
$ParamJSON = $params | ConvertTo-Json -Compress
2121

22-
Write-Host "cf create-service $ServiceName $ServicePlan $ServiceInstanceName -c $ParamJSON -t $ServiceInstanceName"
22+
# Create a redacted copy of the parameters for logging so the password is not exposed
23+
$redactedParams = $params.Clone()
24+
$redactedParams['password'] = 'REDACTED'
25+
$ParamJSONRedacted = $redactedParams | ConvertTo-Json -Compress
2326

27+
Write-Host "cf create-service $ServiceName $ServicePlan $ServiceInstanceName -c $ParamJSONRedacted -t $ServiceInstanceName"
2428
cf create-service $ServiceName $ServicePlan $ServiceInstanceName -c $ParamJSON -t $ServiceInstanceName

0 commit comments

Comments
 (0)