Skip to content

Commit

Permalink
updates
Browse files Browse the repository at this point in the history
  • Loading branch information
danycontre committed Nov 6, 2023
1 parent fe74081 commit 438e81a
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,6 @@ param scriptArguments string
@sys.description('Domain join user password.')
param adminUserPassword string

// =========== //
// Variable declaration //
// =========== //

var varscriptArgumentsWithPassword = '${scriptArguments} -AdminUserPassword ${adminUserPassword} -verbose'

// =========== //
// Deployments //
// =========== //
Expand All @@ -42,7 +36,7 @@ resource dscStorageScript 'Microsoft.Compute/virtualMachines/extensions@2022-08-
settings: {}
protectedSettings: {
fileUris: array(baseScriptUri)
commandToExecute: 'powershell -ExecutionPolicy Unrestricted -File ${file} ${varscriptArgumentsWithPassword}'
commandToExecute: 'powershell -ExecutionPolicy Unrestricted -File ${file} ${scriptArguments} -AdminUserPassword ${adminUserPassword} -verbose'
}
}
}
Binary file modified workload/scripts/DSCStorageScripts.zip
Binary file not shown.
5 changes: 2 additions & 3 deletions workload/scripts/DSCStorageScripts/Configuration.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ param

[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[SecureString] $AdminUserPassword
[string] $AdminUserPassword
)


Expand Down Expand Up @@ -132,14 +132,13 @@ Configuration DomainJoinFileShare

[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[SecureString] $AdminUserPassword
[string] $AdminUserPassword
)

# Import the module that contains the File resource.
Import-DscResource -ModuleName PsDesiredStateConfiguration

$secStringPassword = ConvertTo-SecureString $AdminUserPassword -AsPlainText -Force

Check failure

Code scanning / PSScriptAnalyzer

File 'Configuration.ps1' uses ConvertTo-SecureString with plaintext. This will expose secure information. Encrypted standard strings should be used instead. Error

File 'Configuration.ps1' uses ConvertTo-SecureString with plaintext. This will expose secure information. Encrypted standard strings should be used instead.
#$AdminCred = New-Object System.Management.Automation.PSCredential ($AdminUserName, $AdminUserPassword) # $secStringPassword)
$AdminCred = New-Object System.Management.Automation.PSCredential ($AdminUserName, $secStringPassword)

$ErrorActionPreference = 'Stop'
Expand Down
2 changes: 1 addition & 1 deletion workload/scripts/Manual-DSC-Storage-Scripts.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ param (

[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[SecureString] $AdminUserPassword,
[string] $AdminUserPassword,

[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
Expand Down

0 comments on commit 438e81a

Please sign in to comment.