Skip to content

Commit 40adcc5

Browse files
committed
Added Create-NewLocalAdmin.ps1 and New-TextToSpeeach.ps1 scripts
1 parent 7ffa8d9 commit 40adcc5

File tree

2 files changed

+36
-0
lines changed

2 files changed

+36
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#Paolo Frigo, https://www.scriptinglibrary.com
2+
#requires -runasadministrator
3+
4+
function Create-NewLocalAdmin {
5+
[CmdletBinding()]
6+
param (
7+
[string] $NewLocalAdmin,
8+
[securestring] $Password
9+
)
10+
begin {
11+
}
12+
process {
13+
New-LocalUser "$NewLocalAdmin" -Password $Password -FullName "$NewLocalAdmin" -Description "Temporary local admin"
14+
Write-Verbose "$NewLocalAdmin local user crated"
15+
Add-LocalGroupMember -Group "Administrators" -Member "$NewLocalAdmin"
16+
Write-Verbose "$NewLocalAdmin added to the local administrator group"
17+
}
18+
end {
19+
}
20+
}
21+
$NewLocalAdmin = Read-Host "New local admin username:"
22+
$Password = Read-Host -AsSecureString "Create a password for $NewLocalAdmin"
23+
Create-NewLocalAdmin -NewLocalAdmin $NewLocalAdmin -Password $Password -Verbose

Blog/PowerShell/New-TextToSpeech.ps1

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#Paolo Frigo, https://www.scriptinglibrary.com
2+
3+
# This is just an simple Text To Speech Example
4+
5+
Add-Type –AssemblyName System.Speech
6+
$SpeechSynthesizer = New-Object –TypeName System.Speech.Synthesis.SpeechSynthesizer
7+
#$SpeechSynthesizer.SelectVoice("Microsoft Zira Desktop")
8+
$SpeechSynthesizer.Speak($Text)
9+
10+
# To List of installed voices
11+
#Foreach ($voice in $SpeechSynthesizer.GetInstalledVoices()){
12+
# $Voice.VoiceInfo | Select-Object Gender, Name, Culture, Description
13+
#}

0 commit comments

Comments
 (0)