ws-creator init
Creates a machine folder from a template, with your own user, SSH key, port and subnet. Get-Help Initialize-WsCreatorMachine -Full
Syntax
Section titled “Syntax”Initialize-WsCreatorMachine [-Template] <String> [-Name] <String> [[-User] <String>] [[-PublicKey] <String>] [[-Port] <Int32>] [[-Subnet] <String>] [[-Location] <String>] [-Apply]Description
Section titled “Description”Copies the template into <WS_CREATOR_MACHINES>\<Name>\, rewrites the identity values where ws-creator checks them (user, hostname, SSH port and key, podman subnet, Location), records where the copy comes from (Template, TemplateSource, TemplateVersion, TemplateHash), then validates the result. Nothing is written if validation fails. The machine is yours afterwards: edit it freely, then create the distro with ‘ws-creator new <Name> -Apply’. Templates come from WS_CREATOR_TEMPLATES (local folders or git repos), then the module.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Position | Description |
|---|---|---|---|---|
-Template |
String | true | 1 | Template name, as shown by ‘ws-creator list’. |
-Name |
String | true | 2 | Name of the new machine: folder, distro and hostname. |
-User |
String | false | 3 | Linux user. Default: the Windows user name in lowercase, reduced to [a-z0-9_-]. |
-PublicKey |
String | false | 4 | Public key file in ~\.ssh. Default: id_ed25519.pub. |
-Port |
Int32 | false | 5 | SSH port, unique per machine. Default: the first free one from 2222. |
-Subnet |
String | false | 6 | Podman subnet, unique per machine. Default: the first free 10.89.N.0/24. |
-Location |
String | false | 7 | Folder of the virtual disk. Default: WS_CREATOR_LOCATION, otherwise C:\WSL. |
-Apply |
SwitchParameter | false | named | Write the machine folder. Without it, only shows what would be written. |
Examples
Section titled “Examples”ws-creator init dev my-machineShows the values init would use.
ws-creator init agent-sandbox sandbox -Port 2250 -Apply