-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
96b61eb
commit 66effec
Showing
11 changed files
with
282 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,29 @@ | ||
cls | ||
|
||
# URL of the EXE to download | ||
$exeUrl = "https://scripts.mikethetech.com/audio-info.exe" | ||
|
||
# Path where to save the downloaded EXE | ||
$exePath = "$env:TEMP\audio-info.exe" | ||
|
||
# Download the EXE file to the temporary directory | ||
Invoke-WebRequest -Uri $exeUrl -OutFile $exePath | ||
|
||
# Check if the file exists and if it is not empty | ||
if (Test-Path $exePath) { | ||
$fileLength = (Get-Item $exePath).length | ||
if ($fileLength -gt 0) { | ||
# Run the downloaded EXE in the same PowerShell window | ||
& $exePath | ||
|
||
|
||
} else { | ||
Write-Host "The downloaded file is empty." | ||
} | ||
|
||
# Remove the file after it is executed | ||
Remove-Item $exePath -Force | ||
|
||
} else { | ||
Write-Host "The file download failed or the file is missing." | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,29 @@ | ||
cls | ||
|
||
# URL of the EXE to download | ||
$exeUrl = "https://scripts.mikethetech.com/dxgi-info.exe" | ||
|
||
# Path where to save the downloaded EXE | ||
$exePath = "$env:TEMP\dxgi-info.exe" | ||
|
||
# Download the EXE file to the temporary directory | ||
Invoke-WebRequest -Uri $exeUrl -OutFile $exePath | ||
|
||
# Check if the file exists and if it is not empty | ||
if (Test-Path $exePath) { | ||
$fileLength = (Get-Item $exePath).length | ||
if ($fileLength -gt 0) { | ||
# Run the downloaded EXE in the same PowerShell window | ||
& $exePath | ||
|
||
|
||
} else { | ||
Write-Host "The downloaded file is empty." | ||
} | ||
|
||
# Remove the file after it is executed | ||
Remove-Item $exePath -Force | ||
|
||
} else { | ||
Write-Host "The file download failed or the file is missing." | ||
} |
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file.
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,50 @@ | ||
cls | ||
$Host.UI.RawUI.WindowTitle = "GPU Friendly Names" | ||
Write-Host "Virtual Display Driver GPU 'Friendly Name' Finder`n" | ||
|
||
function Bytes2String { | ||
param([int64]$Bytes) | ||
if ($Bytes -lt 1024) { return "$Bytes bytes" } | ||
$Bytes = [math]::round($Bytes / 1024, 2) | ||
if ($Bytes -lt 1024) { return "$Bytes KB" } | ||
$Bytes = [math]::round($Bytes / 1024, 2) | ||
if ($Bytes -lt 1024) { return "$Bytes MB" } | ||
$Bytes = [math]::round($Bytes / 1024, 2) | ||
if ($Bytes -lt 1024) { return "$Bytes GB" } | ||
$Bytes = [math]::round($Bytes / 1024, 2) | ||
return "$Bytes TB" | ||
} | ||
|
||
try { | ||
if ($IsLinux) { | ||
# Linux GPU detection code (to be implemented) | ||
} else { | ||
$Details = Get-WmiObject Win32_VideoController | ||
if ($Details) { | ||
foreach ($GPU in $Details) { | ||
$Model = $GPU.Caption | ||
$RAMSize = $GPU.AdapterRAM | ||
if ($RAMSize -is [array]) { | ||
$RAMSize = $RAMSize[0] | ||
} | ||
|
||
# Only display GPUs with RAM size greater than 0 | ||
if ($RAMSize -gt 0) { | ||
$ResWidth = $GPU.CurrentHorizontalResolution | ||
$ResHeight = $GPU.CurrentVerticalResolution | ||
$BitsPerPixel = $GPU.CurrentBitsPerPixel | ||
$RefreshRate = $GPU.CurrentRefreshRate | ||
$DriverVersion = $GPU.DriverVersion | ||
$Status = $GPU.Status | ||
|
||
Write-Host "Friendly Name: $Model" | ||
Write-Host "($(Bytes2String $RAMSize) RAM, $ResWidth x $ResHeight pixels, $BitsPerPixel-bit, $RefreshRate Hz, driver $DriverVersion) - status $Status`n" | ||
} | ||
} | ||
} else { | ||
Write-Host "No GPU information found." | ||
} | ||
} | ||
} catch { | ||
Write-Host "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($_.Exception.Message)" | ||
} |
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,38 @@ | ||
<# | ||
.SYNOPSIS | ||
Plays the Imperial March (Star Wars) | ||
.DESCRIPTION | ||
This PowerShell script plays the Imperial March used in the Star Wars film series. | ||
.EXAMPLE | ||
PS> ./play-imperial-march.ps1 | ||
(listen and enjoy) | ||
.LINK | ||
https://github.com/fleschutz/PowerShell | ||
.NOTES | ||
Author: Markus Fleschutz | License: CC0 | ||
#> | ||
|
||
try { | ||
[System.Console]::beep(440, 500) | ||
[System.Console]::beep(440, 500) | ||
[System.Console]::beep(440, 500) | ||
[System.Console]::beep(349, 350) | ||
[System.Console]::beep(523, 150) | ||
[System.Console]::beep(440, 500) | ||
[System.Console]::beep(349, 350) | ||
[System.Console]::beep(523, 150) | ||
[System.Console]::beep(440, 1000) | ||
[System.Console]::beep(659, 500) | ||
[System.Console]::beep(659, 500) | ||
[System.Console]::beep(659, 500) | ||
[System.Console]::beep(698, 350) | ||
[System.Console]::beep(523, 150) | ||
[System.Console]::beep(415, 500) | ||
[System.Console]::beep(349, 350) | ||
[System.Console]::beep(523, 150) | ||
[System.Console]::beep(440, 1000) | ||
exit 0 # success | ||
} catch { | ||
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" | ||
exit 1 | ||
} |
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,93 @@ | ||
# Original script from https://www.reddit.com/r/PowerShell/comments/rlkacf/powershell_matrix_simulator/ | ||
# Optimized slightly and hosted by MikeTheTech | ||
|
||
class Glyph { | ||
[int]$LastPosition | ||
[int]$CurrentPosition | ||
[int]$Velocity = 1 | ||
[int]$Intensity | ||
[double]$IntensityChange | ||
[char]$Current | ||
[char]$Last | ||
|
||
Glyph() { | ||
$this.Setup() | ||
} | ||
|
||
[void]Setup() { | ||
$this.CurrentPosition = $script:rand.Next(-$script:ScreenHeight, [math]::Floor(0.6 * $script:ScreenHeight)) | ||
$this.Intensity = 0 | ||
$this.IntensityChange = $script:rand.Next(1, 20) / 100 | ||
$this.Current = $script:PossibleGlyphs[$script:rand.Next($script:glyphCount)] | ||
$this.Last = $script:PossibleGlyphs[$script:rand.Next($script:glyphCount)] | ||
} | ||
|
||
[void]Move() { | ||
$this.LastPosition = $this.CurrentPosition | ||
$this.Intensity = [Math]::Min(255, $this.Intensity + [Math]::Floor(255 * $this.IntensityChange)) | ||
$this.CurrentPosition += $this.Velocity | ||
$this.Last = $this.Current | ||
|
||
if ($this.Current -ne ' ') { | ||
$this.Current = $script:PossibleGlyphs[$script:rand.Next($script:glyphCount)] | ||
} | ||
|
||
# Reset if out of bounds | ||
if ($this.CurrentPosition -ge $script:ScreenHeight) { | ||
$this.Setup() | ||
} | ||
} | ||
} | ||
|
||
# Global variables setup | ||
$script:rand = [System.Random]::new() | ||
$script:ScreenWidth = $host.UI.RawUI.WindowSize.Width | ||
$script:ScreenHeight = $host.UI.RawUI.WindowSize.Height | ||
$script:PossibleGlyphs = " +=1234567890!@#$%^&*()<>?{}[]<>~".ToCharArray() | ||
$glyphCount = $script:PossibleGlyphs.Count | ||
$script:e = [char]27 | ||
|
||
# Initialize glyph array | ||
[Glyph[]]$AllGlyphs = [Glyph[]]::new($script:ScreenWidth) | ||
for ($i = 0; $i -lt $AllGlyphs.Count; $i++) { | ||
$AllGlyphs[$i] = [Glyph]::new() | ||
} | ||
|
||
# Console settings | ||
[Console]::CursorVisible = $false | ||
$originalBG = [Console]::BackgroundColor | ||
$originalFG = [Console]::ForegroundColor | ||
|
||
# Clear screen with ANSI | ||
Write-Host "$script:e[38;5;16m$script:e[48;5;16m$script:e[H$script:e[J" -NoNewline | ||
|
||
$stopwatch = [System.Diagnostics.Stopwatch]::StartNew() | ||
|
||
# Main loop | ||
while (-not [System.Console]::KeyAvailable) { | ||
if ($stopwatch.Elapsed.TotalMilliseconds -gt 33.33) { | ||
for ($i = 0; $i -lt $script:ScreenWidth; $i++) { | ||
$glyph = $AllGlyphs[$i] | ||
$glyph.Move() | ||
|
||
if ($glyph.CurrentPosition -ge 0) { | ||
[Console]::SetCursorPosition($i, [Math]::Floor($glyph.CurrentPosition)) | ||
[Console]::Write("$script:e[48;5;16m$script:e[38;5;15m$($glyph.Current)") | ||
} | ||
|
||
if ($glyph.LastPosition -ge 0) { | ||
[Console]::SetCursorPosition($i, [Math]::Floor($glyph.LastPosition)) | ||
[Console]::Write("$script:e[48;5;16m$script:e[38;2;0;$($glyph.Intensity);0m$($glyph.Last)") | ||
} | ||
} | ||
$stopwatch.Restart() | ||
} | ||
} | ||
|
||
# Restore console settings | ||
[Console]::BackgroundColor = $originalBG | ||
[Console]::ForegroundColor = $originalFG | ||
|
||
# Exit cleanup | ||
$null = [Console]::ReadKey($true) | ||
Clear-Host |
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,43 @@ | ||
cls | ||
|
||
# Function to check if the script is running as administrator | ||
function Test-Admin { | ||
$identity = [System.Security.Principal.WindowsIdentity]::GetCurrent() | ||
$principal = New-Object System.Security.Principal.WindowsPrincipal($identity) | ||
return $principal.IsInRole([System.Security.Principal.WindowsBuiltInRole]::Administrator) | ||
} | ||
|
||
# Check if the script is running with admin privileges | ||
if (-not (Test-Admin)) { | ||
Write-Host "You need to run this script as an Administrator." -ForegroundColor Red | ||
pause | ||
exit | ||
} | ||
|
||
# Get the Program Files directory (handles both 32-bit and 64-bit installations) | ||
$programFiles = [System.Environment]::GetFolderPath('ProgramFiles') | ||
|
||
# Set the path to where Sunshine is installed (assuming it is in Program Files) | ||
$sunshinePath = Join-Path $programFiles "Sunshine\sunshine.exe" # Modify this if necessary | ||
|
||
# Prompt the user for the new username and password | ||
$username = Read-Host "Enter the new username" | ||
$password = Read-Host "Enter the new password" -AsSecureString | ||
$passwordPlainText = [System.Net.NetworkCredential]::new("", $password).Password # Convert to plain text | ||
|
||
# Change the credentials by running sunshine.exe with the --creds argument | ||
Start-Process -FilePath $sunshinePath -ArgumentList "--creds $username $passwordPlainText" -Wait | ||
|
||
# Restart the Sunshine service | ||
$serviceName = "Sunshine Service" # Replace with the actual service name if different | ||
|
||
# Stop the service if it's running | ||
Stop-Service -Name $serviceName -Force | ||
|
||
# Start the service again | ||
Start-Service -Name $serviceName | ||
|
||
Write-Host "Credentials changed and service restarted successfully." | ||
Write-Host "Your new username is: $username" | ||
Write-Host "Your new password is: $passwordPlainText" | ||
Write-Host "Don't forget to change your password!" |