Skip to content

Instantly share code, notes, and snippets.

View adamdriscoll's full-sized avatar
:bowtie:

Adam Driscoll adamdriscoll

:bowtie:
View GitHub Profile
@adamdriscoll
adamdriscoll / tasks.json
Created May 2, 2023 22:47
Test Config - PSU
{
"version": "2.0.0",
"tasks": [
{
"label": "Start Universal (Test Config)",
"command": "${workspaceFolder}/src/output/Universal.Server.exe",
"type": "process",
"args": [
"--appsettings",
"${workspaceFolder}\\test-configs\\${input:testConfig}"
@adamdriscoll
adamdriscoll / dashboard.ps1
Created November 29, 2022 09:27
People Picker for PowerShell Universal
function Get-User {
1..100 | ForEach-Object {
[PSCustomObject]@{
UserName = "User$_"
First = "Bill"
Last = $_
Avatar = (Get-ChildItem "$Repository\Avatars" | Get-Random).Name
}
}
}
@adamdriscoll
adamdriscoll / fontawesome.brands.txt
Created November 22, 2021 20:54
PowerShell Universal Dashboard v3 Icons
tribution
500px
AccessibleIcon
Accusoft
AcquisitionsIncorporated
Adn
Adversal
Affiliatetheme
Airbnb
Algolia
@adamdriscoll
adamdriscoll / bottom.reg
Created October 8, 2021 01:14
Windows 11 Taskbar at top
Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\StuckRects3]
"Settings"=hex:30,00,00,00,fe,ff,ff,ff,7a,f4,00,00,03,00,00,00,5d,00,00,00,30,\
00,00,00,00,00,00,00,00,00,00,00,80,07,00,00,30,00,00,00,60,00,00,00,01,00,\
00,00
@adamdriscoll
adamdriscoll / Out-ColorString.ps1
Created December 15, 2020 21:28
Out-ColorString
function Out-ColorString {
param([Parameter(ValueFromPipeline = $true)]$InputObject)
Begin {
$Items = @()
}
Process {
$Items += $InputObject
@adamdriscoll
adamdriscoll / eventtimeline.ps1
Created November 17, 2020 21:32
EventTimeLine example
$Path = Join-Path $Env:ProgramData "PowerShellUniversal"
$ExecutablePath = (Join-Path $Path "Universal.Server.exe")
Start-PSUServer -Port 5000 -Configuration {
New-PSUDashboard -Name 'Dashboard' -BaseUrl '/dashboard' -Framework "UniversalDashboard:Latest" -Content {
New-UDDashboard -Title 'Dashboard' -Content {
New-UDHelmet -Content {
New-UDHtmlTag -Tag 'link' -Attributes @{
rel = "stylesheet"
href = 'https://fonts.googleapis.com/icon?family=Material+Icons'
@adamdriscoll
adamdriscoll / dockerfile
Last active July 30, 2020 21:53
PowerShell Universal dockerfile
FROM mcr.microsoft.com/powershell:lts-ubuntu-18.04
LABEL description="Universal - The ultimate platform for building web-based IT Tools"
EXPOSE 5000
COPY [ "./stage", "/home/" ]
ENTRYPOINT ["./home/Universal/Universal.Server"]
@adamdriscoll
adamdriscoll / sendSocket.ps1
Last active June 1, 2020 18:35
Send a command over a socket
function Send-Socket {
param(
$IPAddress,
$Port,
$Command
)
$ipEndpoint = [System.Net.IPEndPoint]::new([System.Net.IPAddress]$IPAddress, $Port)
$socket = [System.Net.Sockets.Socket]::new($ipEndpoint.AddressFamily, 'Stream', 'TCP')
$socket.Connect($ipEndpoint)
Import-Module .\module.psm1
function New-ComponentPage {
param(
$Page
)
New-Page
}
@adamdriscoll
adamdriscoll / UDv3NavDemo.ps1
Last active April 1, 2020 22:46
Universal Dashboard v3 Nav Demo
function New-AppBar {
$Drawer = New-UDDrawer -Children {
New-UDList -Children {
New-UDListItem -Label "Page1" -OnClick { Invoke-UDRedirect -Url "/page1" }
New-UDListItem -Label "Page2" -OnClick { Invoke-UDRedirect -Url "/page2" }
New-UDListItem -Label "Page3" -OnClick { Invoke-UDRedirect -Url "/page3" }
}
}