diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9f97022 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +target/ \ No newline at end of file diff --git a/CHAMP.ps1 b/CHAMP.ps1 index f70aaac..0e0ff0f 100644 --- a/CHAMP.ps1 +++ b/CHAMP.ps1 @@ -1317,12 +1317,12 @@ $Form1.FormBorderStyle = [System.Windows.Forms.FormBorderStyle]::FixedDialog $Form1.MaximizeBox = $false $Form1.Name = "Form1" $Form1.StartPosition = [System.Windows.Forms.FormStartPosition]::CenterParent -$Form1.Text = "CHAMP - 2024.2.19" +$Form1.Text = "CHAMP - 2024.12.30" Function preflight () { $preflightCounter = [int] 0 $preflightDependancies = "" Write-Host "Running Pre-Flight checks...`n" - $currentVersion = "2024.2.19" + $currentVersion = "2024.12.30" $version = Invoke-WebRequest -URI https://git.racooncity.org/brotoskyj/CHAMP/raw/branch/master/version.txt | Select-Object -ExpandProperty Content Write-Host "Version Check:" Write-Host "Local Version: $currentVersion" @@ -1780,7 +1780,7 @@ Function findUserName () { $userSearchSani = $userSearch.Trim() $main.Refresh() Try { - (Get-ADUser -Identity $userSearchSani -Server wvuhs.com) + (Get-ADUser -Identity $userSearchSani -Server wvuhs.com) $userFound = "True" } Catch { @@ -1856,7 +1856,6 @@ Function findUserName () { $main.Refresh() } } - } function userPopout { function Get-ScriptDirectory { @@ -1980,23 +1979,12 @@ function userPopout { findUserName($UNBox) } function OnFormClosing_Form1 { - # $this parameter is equal to the sender (object) - # $_ is equal to the parameter e (eventarg) - - # The CloseReason property indicates a reason for the closure : - # if (($_).CloseReason -eq [System.Windows.Forms.CloseReason]::UserClosing) - - #Sets the value indicating that the event should be canceled. - ($_).Cancel = $False + ($_).Cancel = $False } - $Form2.Add_FormClosing( { OnFormClosing_Form1 } ) - $Form2.Add_Shown({ $Form2.Activate() }) $ModalResult = $Form2.ShowDialog() - # Release the Form $Form2.Dispose() - } $Clear.Add_Click( { @@ -2020,10 +2008,9 @@ $Clear.Add_Click( $AEBox.BackColor = "" $PEBox.BackColor = "" $UNBox.Clear() - } ) - + #Start Computer Functions function CFE() { $pcTag = $textbox1.Text @@ -2101,7 +2088,6 @@ function LAPS () { } } Function REMOTE () { - $pcTag = $textBox1.Text $pcTagSani = $pcTag.Trim() if (( $null -eq $pcTagSani ) -or ($pcTagSani -eq "")) { @@ -2191,7 +2177,19 @@ function geoLocationForm() { $countryTextBox.Location = New-Object System.Drawing.Point(275, 60) $countryTextLabel = New-Object System.Windows.Forms.Label $countryTextLabel.Text = "Country: " - $countryTextLabel.Location = New-Object System.Drawing.Size(225, 60) + $countryTextLabel.Location = New-Object System.Drawing.Point(225, 60) + $stateTextBox = New-Object System.Windows.Forms.TextBox + $stateTextBox.Size = New-Object System.Drawing.Size(165, 35) + $stateTextBox.Location = New-Object System.Drawing.Point(275,100) + $stateTextLabel = New-Object System.Windows.Forms.Label + $stateTextLabel.Text = "State:" + $stateTextLabel.Location = New-Object System.Drawing.Point(225, 100) + $cityTextBox = New-Object System.Windows.Forms.TextBox + $cityTextBox.Size = New-Object System.Drawing.Size(165, 35) + $cityTextBox.Location = New-Object System.Drawing.Point(275,140) + $cityTextLabel = New-Object System.Windows.Forms.Label + $cityTextLabel.Text = "City:" + $cityTextLabel.Location = New-Object System.Drawing.Point(225, 140) $ipLocationSearchButton = New-Object System.Windows.Forms.Button $ipLocationSearchButton.Size = New-Object System.Drawing.Size(50, 23) $ipLocationSearchButton.Location = New-Object System.Drawing.Size(10, 75) @@ -2213,6 +2211,10 @@ function geoLocationForm() { $ispTextLabel, $countryTextBox, $countryTextLabel, + $stateTextBox, + $stateTextLabel, + $cityTextBox, + $cityTextLabel $ipLocationSearchButton ) ) @@ -2220,28 +2222,20 @@ function geoLocationForm() { $ispTextBox.Clear() $countryTextBox.Clear() $ipToSearch = $ipSearchBox.Text - $response = Invoke-RestMethod -Method GET -URI "https://api.iplocation.net/?ip=$ipToSearch" - $ispTextBox.Text = $response.ISP - $countryTextBox.Text = $response.Country_Name + $response = Invoke-RestMethod -Method GET -URI "http://ip-api.com/json/$ipToSearch" + $ispTextBox.Text = $response.isp + $countryTextBox.Text = $response.country + $stateTextBox.Text = $response.regionName + $cityTextBox.Text = $response.city + } $geoLocationFormBox.ShowDialog() } function OnFormClosing_Form1 { - # $this parameter is equal to the sender (object) - # $_ is equal to the parameter e (eventarg) - - # The CloseReason property indicates a reason for the closure : - (($_).CloseReason -eq [System.Windows.Forms.CloseReason]::UserClosing) - - #Sets the value indicating that the event should be canceled. - #($_).Cancel = $False + (($_).CloseReason -eq [System.Windows.Forms.CloseReason]::UserClosing) } - $Form1.Add_FormClosing( { OnFormClosing_Form1 } ) - preflight -# Release of resources $Reader.Close() -# Release the Form $Form1.Dispose() \ No newline at end of file diff --git a/version.txt b/version.txt index 110014d..5e4a0e1 100644 --- a/version.txt +++ b/version.txt @@ -1 +1 @@ -2024.2.19 \ No newline at end of file +2024.12.30 \ No newline at end of file