Cmdlet | Module |
---|---|
Remove-Service | Microsoft.PowerShell.Management |
Get-Uptime | Microsoft.PowerShell.Utility |
Remove-Alias | Microsoft.PowerShell.Utility |
|Cmdlet|Module|
# Fix the locked changed block tracking file for vms in a VMWare environment. | |
# It it achieved by flipping the changed block tracking settings. | |
# Snapshot is used as an alternative so the setting can be changed. | |
# Requires VMWare PowerCLI 5.1 and PowerShell V3 or above. | |
#Add the required PowerPLI cmdlets | |
Add-PSSnapin VMware.VimAutomation.Core | |
#Parameters | |
$vCenter="vCenter" |
# !/bin/bash | |
# Please manually download the omi-1.0.8.4. | |
# The wget doesn't work because of the javascript used in the site | |
# https://collaboration.opengroup.org/omi/documents/34607/omi-1.0.8.4.packages.tar.gz | |
yum -y install pam-devel | |
yum -y install openssl-devel | |
# wget https://collaboration.opengroup.org/omi/documents/34607/omi-1.0.8.4.packages.tar.gz |
<# | |
This is not a complete code and inteneded to be used with other codes. | |
The goal is to grab a collection of names, vms..etc and then: | |
- Do some work to the collection in smaller batches | |
- The batch work should be sent to background for "parallel" execution | |
- Have a way to check the status of each object in the batch work | |
- If completed work(s) is found, pull next object(s) from the collection | |
The status of last batch is not tracked. Improvements can be made in future version. | |
#> |
<# | |
.Synopsis | |
A wrapper for the tasklist /v /s COMPUTERNAME | |
.DESCRIPTION | |
This is a wrapper for the tasklist command. In the case PowerShell remoting is not available, this cmdlet would be useful to gather the process infromation. | |
#> | |
function Get-Tasklist | |
{ | |
[CmdletBinding()] |
function Get-PSWindowsUpdateLog | |
{ | |
<# | |
.Synopsis | |
Parsing WindowsUpdate.log to objects for easy reporting. Default will retrieve the most recent 100 entires only. | |
.DESCRIPTION | |
This function will retrieve and then parse the c:\windows\system32\WindowsUpdate.log on local or remote computers. Using the -all parameter, the full log will be retrieved but this could be lengthy. | |
.EXAMPLE | |
PS E:\_PSTemp> Get-PSWindowsUpdateLog -ComputerName localhost |
# Source: https://blogs.msdn.microsoft.com/mssmallbiz/2016/07/10/how-to-download-all-of-the-free-ebooks-and-resources-in-my-free-ebooks-giveaway/ | |
# Source: http://www.mssmallbiz.com/ericligman/Key_Shorts/MSFTFreeEbooks.txt | |
# Script for convenience. No proper error handling whatsoever. Saves to user's download\FreeEbook folder. | |
# Parsing the http links | |
$LinkSource = 'http://www.mssmallbiz.com/ericligman/Key_Shorts/MSFTFreeEbooks.txt' | |
$link = ((Invoke-WebRequest -Uri $LinkSource).content -split "`n" | where {$_ -like 'http://*'}).trim() | |
$path = '~\Downloads\FreeEBook' |
[ipaddress](((invoke-webrequest -Uri 'http://checkip.amazonaws.com/').Content | % {[char]$_}) -join '').trim() |
$instances = Get-ec2instance -Filter @(@{name = 'platform'; value = 'windows'}) | |
foreach ($i in $instances){ | |
$prop = @{ | |
Name = $i.Name | |
password = Get-EC2PasswordData -InstanceId $i.InstanceId -PemFile "C:\path\to\private\keys\$($i.KeyName).pem" | |
InstanceId = $i.instances.InstanceId | |
} | |
$obj = New-Object -TypeName psobject -Property $prop | |
$obj |
Credit: Mark Kraus
Website: https://get-powershellblog.blogspot.com