In this video, the Kilt Guy goes over a slightly more complex function to be added to our PowerShell script.
Commands discussed:
function
Write-Host
While (loop)
Foreach (loop)
Get-LocalUser
0:00 Intro
0:20 Building a function to create an ArrayList
1:25 Testing one of the variables
1:58 Showing the difference in how information is shown between simply calling the variable and using it as part of "Write-Host"
2:15 Explaining the difference between an Array and ArrayList
2:42 Showing how to create a Global Variable inside a function
3:35 Explaining the While Loop
5:28 Testing the function's While Loop
6:28 Validating the variable
6:51 Creating a foreach loop with the ArrayList and Get-LocalUser
7:50 Outro
Поделиться в:
Доступные форматы для скачивания:
Скачать видео mp4
Информация по загрузке:
Скачать аудио mp3
Похожие видео
array(20) {
["KMfbbbYn7qA"]=>
object(stdClass)#7314 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "KMfbbbYn7qA"
["related_video_title"]=>
string(94) "PowerShell 19 Finding unauthorized users in different LocalGroups and disabling their accounts"
["posted_time"]=>
string(21) "3 года назад"
["channelName"]=>
NULL
}
["shMA83HX74s"]=>
object(stdClass)#7333 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "shMA83HX74s"
["related_video_title"]=>
string(35) "Work with User Inputs on PowerShell"
["posted_time"]=>
string(19) "5 лет назад"
["channelName"]=>
NULL
}
["SPwyp2NG-bE"]=>
object(stdClass)#7315 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "SPwyp2NG-bE"
["related_video_title"]=>
string(52) "you need to learn BASH Scripting RIGHT NOW!! // EP 1"
["posted_time"]=>
string(21) "3 года назад"
["channelName"]=>
NULL
}
["kpYCCs_sgW4"]=>
object(stdClass)#7330 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "kpYCCs_sgW4"
["related_video_title"]=>
string(89) "Учебники PowerShell 7 для начинающих №3: Массив и ArrayList"
["posted_time"]=>
string(21) "3 года назад"
["channelName"]=>
NULL
}
["qrwPvbCWRtI"]=>
object(stdClass)#7316 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "qrwPvbCWRtI"
["related_video_title"]=>
string(20) "PowerShell Functions"
["posted_time"]=>
string(19) "5 лет назад"
["channelName"]=>
NULL
}
["4Rc0aEMXiWw"]=>
object(stdClass)#7334 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "4Rc0aEMXiWw"
["related_video_title"]=>
string(33) "Working With PowerShell Variables"
["posted_time"]=>
string(19) "6 лет назад"
["channelName"]=>
NULL
}
["p0d8JCVJlsw"]=>
object(stdClass)#7322 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "p0d8JCVJlsw"
["related_video_title"]=>
string(28) "PowerShell ForEach Deep Dive"
["posted_time"]=>
string(19) "1 год назад"
["channelName"]=>
NULL
}
["RHxuUQ58yjc"]=>
object(stdClass)#7324 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "RHxuUQ58yjc"
["related_video_title"]=>
string(79) "ЭТИ АЛГОРИТМЫ СДЕЛАЮТ ИЗ ТЕБЯ ПРОГРАММИСТА"
["posted_time"]=>
string(25) "3 недели назад"
["channelName"]=>
NULL
}
["faD7x71E1Jg"]=>
object(stdClass)#7319 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "faD7x71E1Jg"
["related_video_title"]=>
string(97) "Beginner Essential loop examples in PowerShell, basic for loops to advanced foreach-object loops."
["posted_time"]=>
string(21) "2 года назад"
["channelName"]=>
NULL
}
["qwosU7e9mqc"]=>
object(stdClass)#7332 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "qwosU7e9mqc"
["related_video_title"]=>
string(154) "Музыка для работы за компьютером | Фоновая музыка для концентрации и продуктивности"
["posted_time"]=>
string(25) "2 месяца назад"
["channelName"]=>
NULL
}
["rvGd8kxXlVc"]=>
object(stdClass)#7321 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "rvGd8kxXlVc"
["related_video_title"]=>
string(73) "PowerShell Array and ArrayList - storing multiple items as a one variable"
["posted_time"]=>
string(21) "4 года назад"
["channelName"]=>
NULL
}
["4ahIeL3U2g4"]=>
object(stdClass)#7331 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "4ahIeL3U2g4"
["related_video_title"]=>
string(177) "«Макс» — только начало: Кремль закладывает фундамент для цифрового железного занавеса | Разборы"
["posted_time"]=>
string(21) "1 день назад"
["channelName"]=>
NULL
}
["Ye-N92ObhU4"]=>
object(stdClass)#7317 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "Ye-N92ObhU4"
["related_video_title"]=>
string(122) "Comedy Club: Голосовые от друга | Батрутдинов, Карибидис, Шкуро @ComedyClubRussia"
["posted_time"]=>
string(24) "20 часов назад"
["channelName"]=>
NULL
}
["Mgn9uZtgEpo"]=>
object(stdClass)#7305 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "Mgn9uZtgEpo"
["related_video_title"]=>
string(51) "Windows PowerShell [04] Variables, Types & PSDrives"
["posted_time"]=>
string(19) "5 лет назад"
["channelName"]=>
NULL
}
["PwKUw5ljc2o"]=>
object(stdClass)#7306 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "PwKUw5ljc2o"
["related_video_title"]=>
string(79) "Школьник Взломал Playstation, но его Спасли Anonymous"
["posted_time"]=>
string(19) "2 дня назад"
["channelName"]=>
NULL
}
["OAGAYOOz3A8"]=>
object(stdClass)#7312 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "OAGAYOOz3A8"
["related_video_title"]=>
string(136) "Пирамида ОФЗ | Правительство занимает триллионы у россиян (English subtitles) @Max_Katz"
["posted_time"]=>
string(24) "13 часов назад"
["channelName"]=>
NULL
}
["PXBMdIkH24I"]=>
object(stdClass)#7313 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "PXBMdIkH24I"
["related_video_title"]=>
string(30) "PowerShell Arrays Introduction"
["posted_time"]=>
string(19) "8 лет назад"
["channelName"]=>
NULL
}
["SjXzUAokzeE"]=>
object(stdClass)#7311 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "SjXzUAokzeE"
["related_video_title"]=>
string(71) "PowerShell and .NET Basics Using .NET Classes and Objects in PowerShell"
["posted_time"]=>
string(21) "3 года назад"
["channelName"]=>
NULL
}
["Bw3FxLMc1QQ"]=>
object(stdClass)#7309 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "Bw3FxLMc1QQ"
["related_video_title"]=>
string(35) "Mastering PowerShell Dynamic Arrays"
["posted_time"]=>
string(19) "1 год назад"
["channelName"]=>
NULL
}
["Fl5sm9noHJo"]=>
object(stdClass)#7310 (5) {
["video_id"]=>
int(9999999)
["related_video_id"]=>
string(11) "Fl5sm9noHJo"
["related_video_title"]=>
string(0) ""
["posted_time"]=>
string(24) "17 часов назад"
["channelName"]=>
NULL
}
}