(How to shorten (splatting) your powershell commands)
In this video I show you a technique which can be applied on all powershell cmdlets you will find. The technique involves using a hashtable as input. You can shorten (Splatting) your command and make them always fit on 1 line. No need for backticks anymore ;-)
*splatting powershell cmdlets
*powershell
*learn powershell
*automation
*learn automation
*windows
*windows powershell
Code:
Get-ChildItem -path "C:\Users\mark\Downloads" -Recurse:$true -Filter "*.png" -Depth 5
$props = @{
path = "C:\Users\mark\Downloads"
recurse = $true
filter = "*.png"
depth = 5
}
Get-ChildItem @props
Смотрите видео PowerShell - Splatting онлайн, длительностью часов минут секунд в хорошем качестве, которое загружено на канал Mr Automation 02 Ноябрь 2021. Делитесь ссылкой на видео в социальных сетях, чтобы ваши подписчики и друзья так же посмотрели это видео. Данный видеоклип посмотрели 392 раз и оно понравилось 15 посетителям.