22
33Param (
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 ,
7- [string ]$ServiceName = " credhub" ,
8- [string ]$ServicePlan = " default" ,
9- [string ]$ServiceInstanceName = " sampleNetworkShare"
5+ [Parameter (Mandatory = $true )][string ]$UserName ,
6+ [Parameter (Mandatory = $true )][string ]$Password ,
7+ [Parameter ( Mandatory = $false )][ string ]$ServiceName = " credhub" ,
8+ [Parameter ( Mandatory = $false )][ string ]$ServicePlan = " default" ,
9+ [Parameter ( Mandatory = $false )][ string ]$ServiceInstanceName = " sampleNetworkShare"
1010)
1111$ErrorActionPreference = " Stop"
1212
@@ -17,12 +17,12 @@ $params = @{
1717 username = $UserName
1818 password = $Password
1919}
20- $ParamJSON = $params | ConvertTo-Json - Compress
20+ $jsonParams = $params | ConvertTo-Json - Compress
2121
2222# Create a redacted copy of the parameters for logging so the password is not exposed
2323$redactedParams = $params.Clone ()
2424$redactedParams [' password' ] = ' REDACTED'
25- $ParamJSONRedacted = $redactedParams | ConvertTo-Json - Compress
25+ $redactedJsonParams = $redactedParams | ConvertTo-Json - Compress
2626
27- Write-Host " cf create-service $ServiceName $ServicePlan $ServiceInstanceName -c $ParamJSONRedacted -t $ServiceInstanceName "
28- cf create- service $ServiceName $ServicePlan $ServiceInstanceName - c $ParamJSON - t $ServiceInstanceName
27+ Write-Host " cf create-service $ServiceName $ServicePlan $ServiceInstanceName -c $redactedJsonParams -t $ServiceInstanceName "
28+ cf create- service $ServiceName $ServicePlan $ServiceInstanceName - c $jsonParams - t $ServiceInstanceName
0 commit comments