-
-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Showing
1 changed file
with
185 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
$installedVersions = [DynamicSource]@{ | ||
Name = "versions"; | ||
Description = "A all installed node versions"; | ||
CommandExpression = { | ||
nvm list | % { [regex]::match($_, '(\d+\.\d+\.\d+)').Groups[1].Value } | ? {$_.trim() -ne "" } | ||
}; | ||
Cache = [Cache]@{ | ||
ByTime = New-TimeSpan -Seconds 10 | ||
} | ||
} | ||
|
||
$versionsToInstall = [StaticSource]@{ | ||
Name = "Versions to install"; | ||
Description = ""; | ||
Items = @( | ||
[SourceItem]@{ | ||
Name = "latest"; | ||
Description = "" | ||
}, | ||
[SourceItem]@{ | ||
Name = "lts"; | ||
Description = "" | ||
} | ||
) | ||
} | ||
|
||
$architecture = [StaticSource]@{ | ||
Name = "Proxies"; | ||
Description = ""; | ||
Items = @( | ||
[SourceItem]@{ | ||
Name = "64"; | ||
Description = "64 bit" | ||
} | ||
[SourceItem]@{ | ||
Name = "32"; | ||
Description = "32 bit" | ||
} | ||
) | ||
} | ||
|
||
$proxies = [StaticSource]@{ | ||
Name = "Proxies"; | ||
Description = ""; | ||
Items = @( | ||
[SourceItem]@{ | ||
Name = "none"; | ||
Description = "" | ||
} | ||
) | ||
} | ||
|
||
[PowerTypeDictionary]@{ | ||
Platforms = ([Platforms]::Windows); | ||
State = [DictionaryState]::Experimental -bor [DictionaryState]::Complete; | ||
Source = "Hand crafted"; | ||
Url = "https://github.com/coreybutler/nvm-windows"; | ||
Keys = @("nvm"); | ||
Name = "nvm for windows"; | ||
Description = "A node.js version management utility for Windows. Ironically written in Go."; | ||
Parameters = @( | ||
[CommandParameter]@{ | ||
Keys = @("arch"); | ||
Name = "arch"; | ||
Description = "Show if node is running in 32 or 64 bit mode"; | ||
} | ||
[CommandParameter]@{ | ||
Keys = @("current"); | ||
Name = "current"; | ||
Description = "Display active version"; | ||
} | ||
[CommandParameter]@{ | ||
Keys = @("install"); | ||
Name = "install"; | ||
Description = "install specified node version"; | ||
Parameters = @( | ||
[ValueParameter]@{ | ||
Name = "version"; | ||
Description = "version to install"; | ||
Source = $versionsToInstall; | ||
} | ||
[ValueParameter]@{ | ||
Name = "architecture"; | ||
Description = "architecture to install"; | ||
Source = $architecture; | ||
} | ||
); | ||
} | ||
[CommandParameter]@{ | ||
Keys = @("list", "ls"); | ||
Name = "list"; | ||
Description = "List the node.js installations"; | ||
Parameters = @( | ||
[FlagParameter]@{ | ||
Keys = @("available"); | ||
Name = "available"; | ||
Description = "see what can be installed"; | ||
} | ||
); | ||
} | ||
[CommandParameter]@{ | ||
Keys = @("on"); | ||
Name = "on"; | ||
Description = "Enable node.js version management"; | ||
} | ||
[CommandParameter]@{ | ||
Keys = @("off"); | ||
Name = "off"; | ||
Description = "Disable node.js version management"; | ||
} | ||
[CommandParameter]@{ | ||
Keys = @("proxy"); | ||
Name = "proxy"; | ||
Description = "Set a proxy to use for downloads. Leave [url] blank to see the current proxy"; | ||
Parameters = @( | ||
[ValueParameter]@{ | ||
Name = "url"; | ||
Description = "Set [url] to 'none' to remove the proxy"; | ||
Source = $proxies | ||
} | ||
); | ||
} | ||
[CommandParameter]@{ | ||
Keys = @("node_mirror"); | ||
Name = "node_mirror"; | ||
Description = "Set the node mirror"; | ||
Parameters = @( | ||
[ValueParameter]@{ | ||
Name = "url"; | ||
Description = "Defaults to https://nodejs.org/dist/. Leave [url] blank to use default url"; | ||
} | ||
); | ||
} | ||
[CommandParameter]@{ | ||
Keys = @("npm_mirror"); | ||
Name = "npm_mirror"; | ||
Description = "Set the npm mirror"; | ||
Parameters = @( | ||
[ValueParameter]@{ | ||
Name = "url"; | ||
Description = "Defaults to https://github.com/npm/cli/archive/. Leave [url] blank to default url"; | ||
} | ||
); | ||
} | ||
[CommandParameter]@{ | ||
Keys = @("uninstall"); | ||
Name = "uninstall"; | ||
Description = "uninstall specified node version"; | ||
Parameters = @( | ||
[ValueParameter]@{ | ||
Name = "version"; | ||
Description = "version to install"; | ||
Source = $installedVersions; | ||
} | ||
); | ||
} | ||
[CommandParameter]@{ | ||
Keys = @("use"); | ||
Name = "use"; | ||
Description = "Switch to use the specified version"; | ||
Parameters = @( | ||
[ValueParameter]@{ | ||
Name = "version"; | ||
Description = ""; | ||
Source = $installedVersions | ||
} | ||
[ValueParameter]@{ | ||
Name = "architecture"; | ||
Description = "architecture to install"; | ||
Source = $architecture; | ||
} | ||
); | ||
} | ||
[CommandParameter]@{ | ||
Keys = @("root"); | ||
Name = "root"; | ||
Description = "Set the directory where nvm should store different versions of node.js"; | ||
} | ||
[CommandParameter]@{ | ||
Keys = @("version", "v"); | ||
Name = "version"; | ||
Description = "Displays the current running version of nvm for Windows. Aliased as v"; | ||
} | ||
) | ||
} |