From 2b60c6b2fb56b5bdac93f434288a5bf2e2b0da39 Mon Sep 17 00:00:00 2001 From: hattoben Date: Fri, 4 Sep 2026 10:57:51 -0400 Subject: [PATCH] add new file ezupdate.ps1 --- ezupdate.ps1 | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 ezupdate.ps1 diff --git a/ezupdate.ps1 b/ezupdate.ps1 new file mode 100644 index 0000000..c413534 --- /dev/null +++ b/ezupdate.ps1 @@ -0,0 +1,41 @@ +# This script eases network registration and update through a simple menu system +# Ben Hatto 2026 + +# SSH details +$remoteHost = "chavez" +$keyPath = "$HOME\.ssh\id_rsa" + +# Grab netid for SSH later +function Grab-NetID { + Write-Host "Welcome to Easy Reg Update!" + $user = Read-Host -Prompt "Please enter your EGR NetID" +} + +function Send-Command { + param ( + [string]$Command + ) + #connect to chavez and load the profile + ssh -i $keyPath ${user}@${remoteHost} "source ~/.bashrc && $Command && exit" +} + +#ssh to chavez with +function Check-Registration { + "nb-search.pl --email hattoben@egr.msu.edu" +} + +# Prompt user with menu +function Show-Menu { + Write-Host "What would you like to do?" + Write-Host "1) Check Registration `n2) Update Registration" + $choice = Read-Host -Prompt "Enter your selection:" + + switch($choice) { + '1' { + + } + } +} + +Grab-NetID +Send-Command -Command "echo 'hi'" \ No newline at end of file