Skip to content

Commit bbc8e20

Browse files
authored
Add files via upload
1 parent 41037e0 commit bbc8e20

1 file changed

Lines changed: 58 additions & 48 deletions

File tree

cyberWin10.ps1

Lines changed: 58 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ function srchmdia {
3030

3131
function winupd {
3232
Clear-Host
33+
Write-Host("Installing module PSWindowsUpdate if not already installed... ")
3334
Install-Module PSWindowsUpdate
34-
Write-Host("This might take a little bit...")
3535
Get-WindowsUpdate
3636
Install-WindowsUpdate -Confirm
3737
}
@@ -49,7 +49,7 @@ function enblbit {
4949
#main menu function
5050
function main_menu{
5151
Clear-Host
52-
Write-Host("")
52+
Write-Host("Windows 10 CyberPatriots Script created by Michael Brenner for Team Apple Cidr")
5353
Write-Host("Commands:")
5454
Write-Host("")
5555
Write-Host("(1)Search Media Files (2)Windows Update")
@@ -100,12 +100,12 @@ function main_menu{
100100
######user/group menu function#####
101101
function usr_grumnu{
102102
Clear-Host
103-
Write-Host("")
103+
Write-Host("Windows 10 CyberPatriots Script created by Michael Brenner for Team Apple Cidr")
104104
Write-Host("Commands:")
105105
Write-Host("")
106106
Write-Host("(1)Add user to system (2)Remove User from system")
107-
Write-Host("(3)Create New User Group (4)Remove User Group")
108-
Write-Host("(5)Add User to User Group (6)Remove User from User Group")
107+
Write-Host("(3)Create New User Group (4)Remove User Group*")
108+
Write-Host("(5)Add User to User Group* (6)Remove User from User Group*")
109109
Write-Host("(7)List Local Users (8)List Local Groups")
110110
Write-Host("(99)Back ")
111111
Write-Host("")
@@ -114,73 +114,83 @@ function usr_grumnu{
114114

115115
if ($usrcommand -eq '1'){
116116
$aus = Read-Host -Prompt 'Would you like to add a user to this system? [y/n] '
117-
if ($aus -eq 'y'){
118-
$nusnm = Read-Host -Prompt 'What would you like the name of the user to be? '
119-
$nuspss = Read-Host -Prompt -AsSecureString 'Please input a new password for the user '
120-
New-LocalUser $nusnm -Password $nuspss -Confirm
121-
Get-LocalUser
122-
} else {
123-
Read-Host -Prompt 'Press any key to continue... '
124-
break
125-
}
117+
if ($aus -eq 'y'){
118+
$nusnm = Read-Host -Prompt 'What would you like the name of the user to be? '
119+
$nuspss = Read-Host -Prompt -AsSecureString 'Please input a new password for the user '
120+
New-LocalUser $nusnm -Password $nuspss -Confirm
121+
Get-LocalUser
122+
} else {
123+
Read-Host -Prompt 'Press any key to continue... '
124+
break
125+
}
126126
}
127+
127128
if ($usrcommand -eq '2'){
128129
$rusyn = Read-Host -Prompt 'Would you like to remove a user from this system? [y/n] '
129-
if ($rusyn -eq 'y'){
130-
$remvusr = $True
131-
while ($remvusr -eq $True){
132-
Write-Host(Get-LocalUser)
133-
$rus = Read-Host -Prompt 'Which user would you like to remove from the system? '
134-
Remove-LocalUser -Name $rus -Confirm
135-
Write-Host("User " + $rus + " has been removed!")
136-
Write-Host("")
137-
$remvanthusr = Read-Host -Prompt 'Would you like to remove another user? [y/n] '
138-
if ($remvanthusr -eq 'y'){
139-
$remvusr = $True
140-
} else {
141-
$remvusr = $False
142-
}
143-
}
144-
} else {
145-
Read-Host -Prompt 'Press any key to continue... '
146-
break
147-
}
130+
if ($rusyn -eq 'y'){
131+
$remvusr = $True
132+
while ($remvusr -eq $True){
133+
Write-Host(Get-LocalUser)
134+
$rus = Read-Host -Prompt 'Which user would you like to remove from the system? '
135+
Remove-LocalUser -Name $rus -Confirm
136+
Write-Host("User " + $rus + " has been removed!")
137+
Write-Host("")
138+
$remvanthusr = Read-Host -Prompt 'Would you like to remove another user? [y/n] '
139+
if ($remvanthusr -eq 'y'){
140+
$remvusr = $True
141+
} else {
142+
$remvusr = $False
143+
}
144+
} else {
145+
Read-Host -Prompt 'Press any key to continue... '
146+
break
147+
}
148+
}
148149
}
150+
149151
if ($usrcommand -eq '3'){
150152
$crtgruyn = Read-Host -Prompt 'Do you want to create a new local user group? [y/n] '
151-
if ($crtgruyn -eq 'y'){
152-
$crtgru = $True
153-
while ($crtgru -eq $True){
154-
$ngrunm = Read-Host -Prompt 'What is the name of the new group? '
155-
New-LocalGroup -Name $ngrunm
156-
Write-Host("New group " + $ngrunm + " has been created!")
157-
158-
$anotgru = Read-Host -Prompt '
159-
}
160-
} else {
161-
Read-Host -Prompt 'Press any key to continue... '
162-
break
163-
}
153+
if ($crtgruyn -eq 'y'){
154+
$crtgru = $True
155+
while ($crtgru -eq $True){
156+
$ngrunm = Read-Host -Prompt 'What is the name of the new group? '
157+
New-LocalGroup -Name $ngrunm
158+
Write-Host("New group " + $ngrunm + " has been created!")
159+
160+
$anotgru = Read-Host -Prompt 'Would you like to make another local user group? [y/n] '
161+
}
162+
} else {
163+
Read-Host -Prompt 'Press any key to continue... '
164+
break
165+
}
164166
}
167+
165168
if ($usrcommand -eq '4'){
166169

167170
}
171+
168172
if ($usrcommand -eq '5'){
169173

170174
}
175+
171176
if ($usrcommand -eq '6'){
172177

173178
}
179+
174180
if ($usrcommand -eq '7'){
175-
Get-LocalUser
181+
Clear-Host
182+
Get-LocalUser
176183
Read-Host -Prompt 'Press any key to continue... '
177184
usr_grumnu
178185
}
186+
179187
if ($usrcommand -eq '8'){
180-
Get-LocalGroup
188+
Clear-Host
189+
Get-LocalGroup
181190
Read-Host -Prompt 'Press any key to continue... '
182191
usr_grumnu
183192
}
193+
184194
if ($usrcommand -eq '99'){
185195
main_menu
186196
}

0 commit comments

Comments
 (0)