Skip to content

[VMFleet] $Connectpass not escaped preventing launch script from running when special characters are included in the password. #60

Closed
@JosiahBradley

Description

@JosiahBradley

[Note double underscore is escaped by the comment parser]

In create-vmfleet.ps1 line 163 CONNECTPASS is replaced with the raw password provided in parameter $connectpass without being escaped. This means if the password includes a character such as " the launch script inside the vm will not run due to syntax error. Proposed patch below (rough draft doesnt escape everything like ' )

$escapedpassword = "'" + $using:connectpass + "'"
gc C:\ClusterStorage\collect\control\launch-template.ps1 |% { $_ -replace 'CONNECTUSER',$using:connectuser -replace 'CONNECTPASS',$escapedpassword } > z:\users\administrator\launch.ps1

Metadata

Metadata

Assignees

No one assigned

    Labels

    vmfleetIssues related to VM Fleet

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions