Skip to content

Instantly share code, notes, and snippets.

View rchaganti's full-sized avatar
Slow to respond.

Ravikanth C rchaganti

Slow to respond.
View GitHub Profile
param (
[Parameter()]
[ValidateSet('VMM','OM','DPM','SCORH','SM','All')]
[String] $Component = 'All',
[Parameter()]
[String] $Destination = $env:TEMP
)
Begin {
@rchaganti
rchaganti / 2_0-Storage_Account.json
Created November 10, 2015 15:26
ARM Template for deploying storage account
{
"$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#",
"contentVersion": "1.0.0.0",
"parameters": {
"storageAccountName": {
"type": "string",
"defaultValue": "MyARMDemo",
"minLength": 3,
"maxLength": 24,
"metadata": {
Function Get-AvailableIPv4Address {
param (
[System.Collections.ArrayList] $IPRange
)
$MaxThreads = 30
$ScriptBlock = {
Param (
[String]$IPAddress
)
@rchaganti
rchaganti / Get-PENetworkAdapter.ps1
Created November 24, 2014 12:05
Get-PENetworkAdapter
#Download the module from http://en.community.dell.com/techcenter/systems-management/w/wiki/7727.powershell-cmdlets-for-poweredge-servers
Import-Module DellPEPowerShellTools
$idracSession = New-PEDRACSession -Credential (Get-Credential) -IPAddress 192.168.100.1
$NicView = Get-CimInstance -ResourceUri 'http://schemas.dell.com/wbem/wscim/1/cim-schema/2/DCIM_NICView' -Namespace root\dcim -CimSession $idracSession
$NicView | Select DeviceDescription, DeviceNumber, EFIVersion, MediaType
@rchaganti
rchaganti / DSCResourcesISESnippets.ps1
Last active March 13, 2016 11:06
ISE Snippets for DSC Resources (PowerShell 4.0 and 5.0)
$GetTargetResource = @'
#TODO - Add the logic for Get-TagetResource
#TODO - Always return a hashtable from this function
#TODO - Remove $Ensure if it is not required
function Get-TargetResource
{
[OutputType([Hashtable])]
param (
[Parameter()]
[ValidateSet('Present','Absent')]
@rchaganti
rchaganti / Get-AzureStatus.ps1
Last active August 29, 2015 14:05
Get Azure Service Status alerts
Function Get-AzureStatus {
$response = Invoke-RestMethod -Uri 'http://azure.microsoft.com/en-us/status/feed/'
if ($response) {
foreach ($item in $response) {
Write-Host "$($item.Title) : " -NoNewline
Write-Host -ForegroundColor Red "$($item.Description)"
}
} else {
Write-Host -ForegroundColor Green "All is well!"
}
@rchaganti
rchaganti / Reset-AzureVMUserPassword.ps1
Created August 13, 2014 16:17
Reset-AzureVMUserPassword
Function Reset-AzureVMUserPassword {
param (
[String]
$VMName,
[String]
$ServiceName,
[PSCredential]
$Credential
@rchaganti
rchaganti / Open-FWLink.ps1
Last active August 29, 2015 14:04
Open FW Links
Function Test-Url {
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[String] $Url
)
Process {
if ([system.uri]::IsWellFormedUriString($Url,[System.UriKind]::Absolute)) {
$true
Function Test-Url {
[CmdletBinding()]
param (
[Parameter(Mandatory=$true)]
[String] $Url,
[Parameter()]
[Switch] $ReturnUri
)