This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Usage: CheckModule -ModuleName ABC123 | |
function CheckModule{ | |
param($ModuleName) | |
if (Get-Module -ListAvailable -Name $ModuleName) { | |
Write-Host -ForegroundColor Green "$($ModuleName) exists" | |
} | |
else{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
write-host -ForegroundColor Green "Hello World, this is a test script for PowerShell Oneliners" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CD "C:\PATHHERE" | |
Get-ChildItem | Where-Object {($_.CreationTime -lt (Get-Date).AddDays(-60))} | Remove-Item -Force -Recurse |