-
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
Showing
3 changed files
with
261 additions
and
0 deletions.
There are no files selected for viewing
Binary file not shown.
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,10 @@ | ||
<?xml version="1.0" encoding="utf-8" ?> | ||
<configuration> | ||
<startup useLegacyV2RuntimeActivationPolicy="true"> | ||
<supportedRuntime version="v4.0" /> | ||
<supportedRuntime version="v2.0" /> | ||
</startup> | ||
<appSettings> | ||
<add key="EnableWindowsFormsHighDpiAutoResizing" value="true"/> | ||
</appSettings> | ||
</configuration> |
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,251 @@ | ||
#------------------------------------------------------------------------ | ||
# Source File Information (DO NOT MODIFY) | ||
# Source ID: 2120f625-41b2-4772-a426-52ff8076f5f4 | ||
# Source File: D:\Scripts\RefreshNetwork.psf | ||
#------------------------------------------------------------------------ | ||
#region File Recovery Data (DO NOT MODIFY) | ||
<#RecoveryData: | ||
hhIAAB+LCAAAAAAABADVmNtuGjEQhu8r9R2svegV4hQSEhWQwlKkKCcENL2MjHfCunhtZHsT6NN3 | ||
9tQkBYKJihqEhICdf/zPzGex3tYQmHoEvexRSwl+MFzJtlcv17zO50+EtG41n3JJRZ8LuKERdIbw | ||
oMGEN2CflJ6V5+ahVVkJyqSTn8Asscs5tL3R0liIyj+4DNSTKfeVjrL3Ell3qUTuci+NcjV5lYgf | ||
CxtraEuIraaiRAbxRHB2CcuxmoFsT5pNesyOT2pnRw2onp55RKKVtveA+V6b9ggLuQg0ijxfSauV | ||
MFm56Hqg1Ry0Xebqc8ZgbruxtUoWMRiFCQH1DPKwSRpwe+mRSpGoUmTalDm2asSogB6PQCa1oomT | ||
EqkduUuvVQBep481bNX4goO0I/4LBfXaMa7TqG0VJbPoKh2AHtmlSJbiCwh6nAo13Sq+pgse4Xpd | ||
tUAhFQa2S7jcVZLw5nVWh7xVOLJU24Ey3PJktD52B8tkGkBu1Y5hYb1iK5CNK357xKS55ErRYJ3P | ||
++RCq5KGFrrtO8cPgc2wS3vfPSxZaKIWQ5hyXEj3bkZvbZ813CUJAEsf63h1mhvicTYWp5prHVRX | ||
itFsjrU6ol2tO2gyctYU6KDN9lGt2iiResMhfkwnFzIApNopOscrc0TcLH034Ktojm2YCEgyDAFX | ||
1FxOnXuPKe64ialId3uXspmvhNKb9S8Bz4flh1ROk3mvaez965i/qK9k2H/oTSDh6WLw8TdA8z38 | ||
p7Xtlf3Vf7bN7KMb4mTn43KfNvTwmRdADRwC9Y33UJ9Xt1fuXXwV3Kd+Dp38vKmHzn5fxCY8jDue | ||
3dEvitsr+atHjE3kp3YO/FanaOk/5j47fe6d+ucz7C60n0sWJn3rKlTjaX7Ip+HqaXRVlx0ih2DQ | ||
rde5vdwR+dPkLv/EGfqiNmfYm3hCrjvdr/xhverM+hcazb86mfnfpF+rGB0gPbPnHt4///gG2a+/ | ||
nBsDEVIIJn1A0qq8fO7U+Q0wPirYhhIAAA==#> | ||
#endregion | ||
|
||
<# | ||
.NOTES | ||
-------------------------------------------------------------------------------- | ||
Code generated by: SAPIEN Technologies, Inc., PowerShell Studio 2018 v5.5.148 | ||
Generated on: 17/01/2019 14:44 | ||
Generated by: Fitoussi | ||
-------------------------------------------------------------------------------- | ||
.DESCRIPTION | ||
GUI script generated by PowerShell Studio 2018 | ||
#> | ||
|
||
|
||
#---------------------------------------------- | ||
#region Application Functions | ||
#---------------------------------------------- | ||
|
||
#endregion Application Functions | ||
|
||
#---------------------------------------------- | ||
# Generated Form Function | ||
#---------------------------------------------- | ||
function Show-RefreshNetwork_psf { | ||
|
||
#---------------------------------------------- | ||
#region Import the Assemblies | ||
#---------------------------------------------- | ||
[void][reflection.assembly]::Load('System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089') | ||
[void][reflection.assembly]::Load('System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') | ||
#endregion Import Assemblies | ||
|
||
#---------------------------------------------- | ||
#region Generated Form Objects | ||
#---------------------------------------------- | ||
[System.Windows.Forms.Application]::EnableVisualStyles() | ||
$formRefreshNetwork = New-Object 'System.Windows.Forms.Form' | ||
$checkboxRegisterDNS = New-Object 'System.Windows.Forms.CheckBox' | ||
$checkboxRenewIP = New-Object 'System.Windows.Forms.CheckBox' | ||
$checkboxReleaseIP = New-Object 'System.Windows.Forms.CheckBox' | ||
$checkboxFlushDNS = New-Object 'System.Windows.Forms.CheckBox' | ||
$buttonOK = New-Object 'System.Windows.Forms.Button' | ||
$InitialFormWindowState = New-Object 'System.Windows.Forms.FormWindowState' | ||
#endregion Generated Form Objects | ||
|
||
#---------------------------------------------- | ||
# User Generated Script | ||
#---------------------------------------------- | ||
|
||
$formRefreshNetwork_Load={ | ||
#TODO: Initialize Form Controls here | ||
|
||
} | ||
|
||
$buttonOK_MouseClick=[System.Windows.Forms.MouseEventHandler]{ | ||
#Event Argument: $_ = [System.Windows.Forms.MouseEventArgs] | ||
#Place custom script here | ||
if ($checkboxFlushDNS.Checked) | ||
{ | ||
ipconfig /flushdns | ||
} | ||
if ($checkboxReleaseIP.Checked) | ||
{ | ||
ipconfig /release | ||
} | ||
if ($checkboxRenewIP.Checked) | ||
{ | ||
ipconfig /renew | ||
} | ||
if ($checkboxRegisterDNS.Checked) | ||
{ | ||
ipconfig /registerdns | ||
} | ||
} | ||
|
||
$checkboxFlushDNS_CheckedChanged={ | ||
#TODO: Place custom script here | ||
|
||
} | ||
|
||
$checkboxReleaseIP_CheckedChanged={ | ||
#TODO: Place custom script here | ||
|
||
} | ||
|
||
$checkboxRenewIP_CheckedChanged={ | ||
#TODO: Place custom script here | ||
|
||
} | ||
|
||
$checkboxRegisterDNS_CheckedChanged={ | ||
#TODO: Place custom script here | ||
|
||
} | ||
|
||
# --End User Generated Script-- | ||
#---------------------------------------------- | ||
#region Generated Events | ||
#---------------------------------------------- | ||
|
||
$Form_StateCorrection_Load= | ||
{ | ||
#Correct the initial state of the form to prevent the .Net maximized form issue | ||
$formRefreshNetwork.WindowState = $InitialFormWindowState | ||
} | ||
|
||
$Form_Cleanup_FormClosed= | ||
{ | ||
#Remove all event handlers from the controls | ||
try | ||
{ | ||
$checkboxRegisterDNS.remove_CheckedChanged($checkboxRegisterDNS_CheckedChanged) | ||
$checkboxRenewIP.remove_CheckedChanged($checkboxRenewIP_CheckedChanged) | ||
$checkboxReleaseIP.remove_CheckedChanged($checkboxReleaseIP_CheckedChanged) | ||
$checkboxFlushDNS.remove_CheckedChanged($checkboxFlushDNS_CheckedChanged) | ||
$buttonOK.remove_MouseClick($buttonOK_MouseClick) | ||
$formRefreshNetwork.remove_Load($formRefreshNetwork_Load) | ||
$formRefreshNetwork.remove_Load($Form_StateCorrection_Load) | ||
$formRefreshNetwork.remove_FormClosed($Form_Cleanup_FormClosed) | ||
} | ||
catch { Out-Null <# Prevent PSScriptAnalyzer warning #> } | ||
} | ||
#endregion Generated Events | ||
|
||
#---------------------------------------------- | ||
#region Generated Form Code | ||
#---------------------------------------------- | ||
$formRefreshNetwork.SuspendLayout() | ||
# | ||
# formRefreshNetwork | ||
# | ||
$formRefreshNetwork.Controls.Add($checkboxRegisterDNS) | ||
$formRefreshNetwork.Controls.Add($checkboxRenewIP) | ||
$formRefreshNetwork.Controls.Add($checkboxReleaseIP) | ||
$formRefreshNetwork.Controls.Add($checkboxFlushDNS) | ||
$formRefreshNetwork.Controls.Add($buttonOK) | ||
$formRefreshNetwork.AcceptButton = $buttonOK | ||
$formRefreshNetwork.AutoScaleDimensions = '6, 13' | ||
$formRefreshNetwork.AutoScaleMode = 'Font' | ||
$formRefreshNetwork.ClientSize = '215, 141' | ||
$formRefreshNetwork.FormBorderStyle = 'FixedDialog' | ||
$formRefreshNetwork.MaximizeBox = $False | ||
$formRefreshNetwork.MinimizeBox = $False | ||
$formRefreshNetwork.Name = 'formRefreshNetwork' | ||
$formRefreshNetwork.StartPosition = 'CenterScreen' | ||
$formRefreshNetwork.Text = 'Refresh Network' | ||
$formRefreshNetwork.add_Load($formRefreshNetwork_Load) | ||
# | ||
# checkboxRegisterDNS | ||
# | ||
$checkboxRegisterDNS.Checked = $True | ||
$checkboxRegisterDNS.CheckState = 'Checked' | ||
$checkboxRegisterDNS.Location = '12, 102' | ||
$checkboxRegisterDNS.Name = 'checkboxRegisterDNS' | ||
$checkboxRegisterDNS.Size = '104, 24' | ||
$checkboxRegisterDNS.TabIndex = 4 | ||
$checkboxRegisterDNS.Text = 'Register DNS' | ||
$checkboxRegisterDNS.UseCompatibleTextRendering = $True | ||
$checkboxRegisterDNS.UseVisualStyleBackColor = $True | ||
$checkboxRegisterDNS.add_CheckedChanged($checkboxRegisterDNS_CheckedChanged) | ||
# | ||
# checkboxRenewIP | ||
# | ||
$checkboxRenewIP.Checked = $True | ||
$checkboxRenewIP.CheckState = 'Checked' | ||
$checkboxRenewIP.Location = '12, 72' | ||
$checkboxRenewIP.Name = 'checkboxRenewIP' | ||
$checkboxRenewIP.Size = '104, 24' | ||
$checkboxRenewIP.TabIndex = 3 | ||
$checkboxRenewIP.Text = 'Renew IP' | ||
$checkboxRenewIP.UseCompatibleTextRendering = $True | ||
$checkboxRenewIP.UseVisualStyleBackColor = $True | ||
$checkboxRenewIP.add_CheckedChanged($checkboxRenewIP_CheckedChanged) | ||
# | ||
# checkboxReleaseIP | ||
# | ||
$checkboxReleaseIP.Checked = $True | ||
$checkboxReleaseIP.CheckState = 'Checked' | ||
$checkboxReleaseIP.Location = '12, 42' | ||
$checkboxReleaseIP.Name = 'checkboxReleaseIP' | ||
$checkboxReleaseIP.Size = '104, 24' | ||
$checkboxReleaseIP.TabIndex = 2 | ||
$checkboxReleaseIP.Text = 'Release IP' | ||
$checkboxReleaseIP.UseCompatibleTextRendering = $True | ||
$checkboxReleaseIP.UseVisualStyleBackColor = $True | ||
$checkboxReleaseIP.add_CheckedChanged($checkboxReleaseIP_CheckedChanged) | ||
# | ||
# checkboxFlushDNS | ||
# | ||
$checkboxFlushDNS.Checked = $True | ||
$checkboxFlushDNS.CheckState = 'Checked' | ||
$checkboxFlushDNS.Location = '12, 12' | ||
$checkboxFlushDNS.Name = 'checkboxFlushDNS' | ||
$checkboxFlushDNS.Size = '104, 24' | ||
$checkboxFlushDNS.TabIndex = 1 | ||
$checkboxFlushDNS.Text = 'Flush DNS' | ||
$checkboxFlushDNS.UseCompatibleTextRendering = $True | ||
$checkboxFlushDNS.UseVisualStyleBackColor = $True | ||
$checkboxFlushDNS.add_CheckedChanged($checkboxFlushDNS_CheckedChanged) | ||
# | ||
# buttonOK | ||
# | ||
$buttonOK.Anchor = 'Bottom, Right' | ||
$buttonOK.DialogResult = 'OK' | ||
$buttonOK.Location = '128, 106' | ||
$buttonOK.Name = 'buttonOK' | ||
$buttonOK.Size = '75, 23' | ||
$buttonOK.TabIndex = 0 | ||
$buttonOK.Text = '&OK' | ||
$buttonOK.UseCompatibleTextRendering = $True | ||
$buttonOK.UseVisualStyleBackColor = $True | ||
$buttonOK.add_MouseClick($buttonOK_MouseClick) | ||
$formRefreshNetwork.ResumeLayout() | ||
#endregion Generated Form Code | ||
|
||
#---------------------------------------------- | ||
|
||
#Save the initial state of the form | ||
$InitialFormWindowState = $formRefreshNetwork.WindowState | ||
#Init the OnLoad event to correct the initial state of the form | ||
$formRefreshNetwork.add_Load($Form_StateCorrection_Load) | ||
#Clean up the control events | ||
$formRefreshNetwork.add_FormClosed($Form_Cleanup_FormClosed) | ||
#Show the Form | ||
return $formRefreshNetwork.ShowDialog() | ||
|
||
} #End Function | ||
|
||
#Call the form | ||
Show-RefreshNetwork_psf | Out-Null |