This file contains hidden or 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
{ | |
"version": "0.1.0", | |
"tasks": [ | |
{ | |
"taskName": "build", | |
"command": "powershell", | |
"args": ["Merge-Script -Script '${file}' -Bundle -OutputPath '${fileDirname}\\out' -OutputType Executable"], | |
"isBuildCommand": true, | |
"showOutput": "silent" | |
} |
This file contains hidden or 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
function Get-BoundParameter { | |
param($commandAst) | |
$psuedoParameterBinderType = [System.Management.Automation.AliasInfo].Assembly.GetType('System.Management.Automation.Language.PseudoParameterBinder') | |
$bindingTypeType = [System.Management.Automation.AliasInfo].Assembly.GetType('System.Management.Automation.Language.PseudoParameterBinder+BindingType') | |
$psuedoParameterBinder = [Activator]::CreateInstance($psuedoParameterBinderType) | |
$DoPseudoParameterBinding = $psuedoParameterBinderType.GetMethod('DoPseudoParameterBinding', [System.Reflection.BindingFlags]::Instance -bor [System.Reflection.BindingFlags]::NonPublic) | |
$pseudoBindingInfoType = [System.Management.Automation.AliasInfo].Assembly.GetType('System.Management.Automation.Language.PseudoBindingInfo') | |
$bindingInfo = $DoPseudoParameterBinding.Invoke($psuedoParameterBinder, @($commandAst, $null, $null, $bindingTypeType.GetEnumValues()[0])) |
This file contains hidden or 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
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<!-- | |
Configure your application settings in appsettings.json. Learn more at http://go.microsoft.com/fwlink/?LinkId=786380 | |
--> | |
<system.webServer> | |
<handlers> | |
<add name="aspNetCore" path="*" verb="*" modules="AspNetCoreModule" resourceType="Unspecified" /> | |
</handlers> | |
<aspNetCore processPath=".\net451\universaldashboard.exe" arguments="" stdoutLogEnabled="true" stdoutLogFile="\\?\%home%\LogFiles\stdout" forwardWindowsAuthToken="false" /> |
This file contains hidden or 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
function New-Circle { | |
param($Color) | |
New-UDElement -Tag "svg" -Content { | |
New-UDElement -Tag "circle" -Attributes @{ | |
cx = "50" | |
cy = "50" | |
r = "40" | |
stroke = "black" | |
strokeWidth = 1 |
This file contains hidden or 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
$dashboard = New-UDDashboard -Title "PowerShell Universal Dashboard" -Content { | |
New-UDRow -Columns { | |
New-UDColumn -Size 1 { | |
New-UDElement -Tag "input" -Attributes @{ | |
type = "button" | |
value = "Click me!" | |
onClick = { | |
$Element = Get-UDElement -Id "textbox" | |
if ($Element.Content[0] -eq "Wax on") { | |
Set-UDElement -Id "textbox" -Content { |
This file contains hidden or 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
$dashboard = New-UDDashboard -Title "PowerShell Universal Dashboard" -Content { | |
New-UDRow -Columns { | |
New-UDColumn -Size 1 { | |
New-UDElement -Tag "a" -Attributes @{ | |
className = "btn" | |
onClick = { | |
$percent = 0 | |
while($percent -le 100) { | |
Set-UDElement -Id "status" -Content {"$percent%"} |
This file contains hidden or 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
$dashboard = New-UDDashboard -Title "Test" -Content { | |
New-UDMonitor -Title "Monitor" -Id "Monitor" -ChartBackgroundColor @("#80962F23", "#8014558C") -ChartBorderColor @("#80962F23", "#8014558C") -Label @("Virutal Memory", "Physical Memory") -Type Line -EndPoint { | |
Out-UDMonitorData -Data @( | |
Get-Random | |
Get-Random | |
) | |
} | |
} |
This file contains hidden or 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
Get-Process | Out-UDGridView |
This file contains hidden or 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
$FormatData = Get-FormatData -TypeName (Get-Process | Get-Member).TypeName | |
if ($FormatData -ne $null) { | |
$TableControl = $FormatData.FormatViewDefinition.Control | Where-Object { $_ -is [System.Management.Automation.TableControl] } | |
if ($TableControl -ne $null) { | |
$Row = $TableControl.Rows | Select-Object -First 1 | |
$i = 0 | |
foreach($Header in $TableControl.Headers) { | |
if ([String]::IsNullOrEmpty($Header.Label)) { |
This file contains hidden or 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
$Ports = Get-CimInstance -ClassName MSFT_NetTCPConnection -Namespace root\StandardCimv2 | Where-Object State -eq 'Listen' | |
$Port = 10000 | |
foreach($Port in 10000..20000) { | |
if (($Ports.LocalPort | Where-Object { $_ -eq $Port } | Measure-Object).Count -eq 0) | |
{ | |
break | |
} | |
} |