Skip to content

Instantly share code, notes, and snippets.

@gsmitheidw
Last active March 21, 2024 11:18
Show Gist options
  • Save gsmitheidw/858deedc10c035be35d2a44efcdaa66e to your computer and use it in GitHub Desktop.
Save gsmitheidw/858deedc10c035be35d2a44efcdaa66e to your computer and use it in GitHub Desktop.
#Send Keypresses
$wshell = new-object -com wscript.shell
$wshell.SendKeys("{CAPSLOCK}")
# Graphical input
$data = [Microsoft.VisualBasic.Interaction]::InputBox('hi user give me your data', 'inputboxtitle')
# Graphical output
[Microsoft.VisualBasic.Interaction]::MsgBox("tada", "OKOnly,SystemModal,Information", "msgboxtitle")
# BIOS info:
Get-CimInstance -ClassName Win32_ComputerSystemProduct # gives make and model & service tag of dell
Get-CimInstance win32_SystemEnclosure
Get-CimInstance Win32_BaseBoard
# Delete profiles older than 30 days
Get-CimInstance Win32_UserProfile | where {$_.LastUseTime -lt (Get-Date).AddDays(-30) -and $_.Special -eq $false} | Remove-CimInstance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment