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
:(){ :|: & };: |
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
# Provide Folder name and create | |
$Folder=’C:\Demo’ | |
New-Item -ItemType Directory -Path $Folder | |
# Create a series of 10 files | |
for ($x=0;$x -lt 10; $x++) | |
{ | |
# Let’s create a completely random filename |
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
param($minutes = 9999) | |
$myShell = New-Object -com "Wscript.Shell" | |
for ($i = 0; $i -lt $minutes; $i++) { | |
Start-Sleep -Seconds 30 | |
$myShell.sendkeys("{F17}") | |
} |
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
####### CHANGE "NewName" TO DESIRED PC NAME, UNCOMMENT THE LINE ####### | |
$Computername = "" | |
Remove-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "Hostname" | |
Remove-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters" -name "NV Hostname" | |
New-PSDrive -name HKU -PSProvider "Registry" -Root "HKEY_USERS" | |
Set-ItemProperty -path "HKLM:\SYSTEM\CurrentControlSet\Control\Computername\Computername" -name "Computername" -value $Computername |
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
$outlook = New-Object -comObject Outlook.Application | |
$outlook.Session.Stores | where { ($_.FilePath -like '*.PST') } | format-table DisplayName, FilePath -autosize |
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
[System.Guid]::NewGuid() |
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
function Get-ComObject { | |
param( | |
[Parameter(Mandatory=$true, | |
ParameterSetName='FilterByName')] | |
[string]$Filter, | |
[Parameter(Mandatory=$true, | |
ParameterSetName='ListAllComObjects')] | |
[switch]$ListAll |
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
Add-Type -AssemblyName System.speech; (New-Object -TypeName System.Speech.Synthesis.SpeechSynthesizer).Speak("Hello!") |
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
$Output= @() | |
$names = $(1..255 | %{"192.168.1.$_"}) | |
foreach ($name in $names){ | |
if (Test-Connection -Delay 15 -ComputerName $name -Count 1 -ErrorAction SilentlyContinue){ | |
$Output+= "$name,up" | |
Write-Host "$Name,up" -ForegroundColor Green | |
} | |
else{ | |
$Output+= "$name,down" | |
Write-Host "$Name,down" -ForegroundColor Red |
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
python -m pip install SOMETHING --trusted-host=pypi.python.org --trusted-host=pypi.org --trusted-host=files.pythonhosted.org |