Skip to main content

Posts

Showing posts from 2019

PowerShell Tricks

Power shell scripts SESSION STATE ELEVATION https://sitecorepowershell.com/session-state-elevation/ Get Child Item Count Get-childItem -Path "master:\sitecore\media library\Sites\" -Recurse | Where-Object { $_.TemplateName -eq "Pdf"} | Measure-Object Objects PS C:\> $files = dir PS C:\>  $files PS C:\>  Get-Service | Out-GridView Sorting PS C:\>  $files|sort -Property length PS C:\>  $files|sort -Property length -Descending Filtering $files| Where-Object Length -gt 212569458 $files | Where-Object Name -eq "InExpEditor.mp4" $files | Where-Object Name -Like "V*" $files | Where-Object {$_.Length -gt 200000000} $files | Where-Object {($_.Length -gt 200000000) -and ($_.Name -like "D*")} Loops 1..10 | foreach{ " This number is " + $_ } 1..10 | foreach{ if($_%2){"$_ is odd number "} } Arrays $strComputers = @("computer1","computer2","computer3") $strComputers | foreach{ $_ + ...