InjectFirstVersion
This commit is contained in:
parent
73b2587b93
commit
1a4acedfbc
2 changed files with 98 additions and 0 deletions
98
Ticket-Counter.ps1
Normal file
98
Ticket-Counter.ps1
Normal file
|
@ -0,0 +1,98 @@
|
|||
|
||||
|
||||
function Get-HotReload {
|
||||
|
||||
$Form.Close()
|
||||
$headers = @{Authorization = "Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpZCI6IjY3ZDcwYTQ5Y2Y0MzhmZGU0NGM2ZWY4YyIsImlhdCI6MTc0MjE0NjMyNSwiZXhwIjoxNzQyMTQ2NjI1fQ.8I2KXZOjUSMVsNxKHYCimnhKlUPkv4cFrx2v5Xdx4E4"}
|
||||
$response = Invoke-RestMethod -Uri "https://app.poshgui.com/api/hotreload/winform/67d70a49cf438fde44c6ef8c" -Method Get -Headers $headers
|
||||
iex $response
|
||||
}
|
||||
|
||||
|
||||
|
||||
Add-Type -Name Window -Namespace Console -MemberDefinition '
|
||||
[DllImport("Kernel32.dll")]
|
||||
public static extern IntPtr GetConsoleWindow();
|
||||
|
||||
[DllImport("user32.dll")]
|
||||
public static extern bool ShowWindow(IntPtr hWnd, Int32 nCmdShow);'
|
||||
|
||||
[Console.Window]::ShowWindow([Console.Window]::GetConsoleWindow(), 0)
|
||||
|
||||
<#
|
||||
.NAME
|
||||
Ticket-Counter
|
||||
|
||||
#>
|
||||
|
||||
Add-Type -AssemblyName System.Windows.Forms
|
||||
[System.Windows.Forms.Application]::EnableVisualStyles()
|
||||
|
||||
$Form = New-Object system.Windows.Forms.Form
|
||||
$Form.ClientSize = New-Object System.Drawing.Point(241,91)
|
||||
$Form.text = "Form"
|
||||
$Form.TopMost = $false
|
||||
|
||||
$Label1 = New-Object system.Windows.Forms.Label
|
||||
$Label1.text = "Month Count"
|
||||
$Label1.AutoSize = $true
|
||||
$Label1.width = 50
|
||||
$Label1.height = 10
|
||||
$Label1.location = New-Object System.Drawing.Point(12,71)
|
||||
$Label1.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
|
||||
|
||||
$Label2 = New-Object system.Windows.Forms.Label
|
||||
$Label2.text = "Day Count"
|
||||
$Label2.AutoSize = $true
|
||||
$Label2.width = 50
|
||||
$Label2.height = 10
|
||||
$Label2.location = New-Object System.Drawing.Point(12,48)
|
||||
$Label2.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
|
||||
|
||||
$Button1 = New-Object system.Windows.Forms.Button
|
||||
$Button1.text = "button"
|
||||
$Button1.width = 167
|
||||
$Button1.height = 30
|
||||
$Button1.location = New-Object System.Drawing.Point(7,7)
|
||||
$Button1.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
|
||||
|
||||
$Button2 = New-Object system.Windows.Forms.Button
|
||||
$Button2.text = "button"
|
||||
$Button2.width = 57
|
||||
$Button2.height = 30
|
||||
$Button2.location = New-Object System.Drawing.Point(178,7)
|
||||
$Button2.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
|
||||
|
||||
$Label3 = New-Object system.Windows.Forms.Label
|
||||
$Label3.text = "1"
|
||||
$Label3.AutoSize = $true
|
||||
$Label3.width = 50
|
||||
$Label3.height = 10
|
||||
$Label3.location = New-Object System.Drawing.Point(102,48)
|
||||
$Label3.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
|
||||
|
||||
$Label4 = New-Object system.Windows.Forms.Label
|
||||
$Label4.text = "0"
|
||||
$Label4.AutoSize = $true
|
||||
$Label4.width = 50
|
||||
$Label4.height = 10
|
||||
$Label4.location = New-Object System.Drawing.Point(102,71)
|
||||
$Label4.Font = New-Object System.Drawing.Font('Microsoft Sans Serif',10)
|
||||
|
||||
$hotreload = New-Object system.Windows.Forms.PictureBox
|
||||
$hotreload.width = 60
|
||||
$hotreload.height = 30
|
||||
$hotreload.location = New-Object System.Drawing.Point(181,1)
|
||||
$hotreload.imageLocation = "https://app.poshgui.com/images/refresh.png"
|
||||
$hotreload.SizeMode = [System.Windows.Forms.PictureBoxSizeMode]::zoom
|
||||
$Form.controls.AddRange(@($Label1,$Label2,$Button1,$Button2,$Label3,$Label4,$hotreload))
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
$hotreload.Add_Click({Get-HotReload})
|
||||
|
||||
|
||||
[void]$Form.ShowDialog()
|
BIN
Ticket-Counter.zip
Normal file
BIN
Ticket-Counter.zip
Normal file
Binary file not shown.
Loading…
Add table
Reference in a new issue