full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/IseSteroids/Technet/Get-IPObjectDefaultEnabledFormatNonIPOutput.ps1 | Get-IPObjectDefaultEnabledFormatNonIPOutput.ps1 | # ------------------------------------------------------------------------
# NAME: Get-IPObjectDefaultEnabledFormatNonIPOutput.ps1
# AUTHOR: ed wilson, Microsoft
# DATE:2/18/2009
#
# KEYWORDS: Function, default value, type constraint,
# Get-WmiObject
# COMMENTS: This demonstrates a function that obtains
# infor... |
PowerShellCorpus/IseSteroids/Technet/Zip-File.ps1 | Zip-File.ps1 |
Function Zip-File () {
[CmdletBinding(DefaultParameterSetName="Add")]
Param(
[Parameter(Mandatory=$True, ParameterSetName="Add")]
[Parameter(Mandatory=$True, ParameterSetName="Remove")]
[Parameter(Mandatory=$True, ParameterSetName="Extract")]
[Parameter(Mandatory=$True, ParameterSetNam... |
PowerShellCorpus/IseSteroids/Technet/DhcpFailoverAutoConfigSyncTool.ps1 | DhcpFailoverAutoConfigSyncTool.ps1 | $configFileName=$([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('LgBcAEMAbwBuAGYAaQBnAF8AQQB1AHQAbwBTAHkAbgBjAC4AeABtAGwA')))
$sleepTimeInMilliSecs=0
$sleepTimeValueInMin=0
$masterMode=$true
$bkmrkName=$([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('UABTAEQAaABjAHAAQQB1AHQAbw... |
PowerShellCorpus/IseSteroids/Technet/ExecNonQuery.ps1 | ExecNonQuery.ps1 | #########################################################
# Script: SqlExecNonQuery.ps1 #
# Created By: Nathon Dalton #
# Created On: 08/16/2011 #
# Description: Execute a command against a SQL database #
# without re... |
PowerShellCorpus/IseSteroids/Technet/TestMAPIConnectivity.ps1 | TestMAPIConnectivity.ps1 |
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
$SRVSettings = Get-ADServerSettings
if ($SRVSettings.ViewEntireForest -eq "False")
{
Set-ADServerSettings -ViewEntireForest $true
}
$MAPIMBX = (Get-MAilboxDatabase | Test-MAPIConnectivity)
$ClassHeaderMC = "heading1"
foreach($MC in $MAPIMBX... |
PowerShellCorpus/IseSteroids/Technet/Update-DPMSpreadSheet.ps1 | Update-DPMSpreadSheet.ps1 |
[CmdletBinding()]
Param
(
$ComputerName = @($([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('ZgBzADEALgBjAG8AbQBwAGEAbgB5AC4AYwBvAG0A'))),$([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('ZgBzADIALgBjAG8AbQBwAGEAbgB5AC4AYwBvAG0A')))),
$SharedDrives = @('G','W','U'),
... |
PowerShellCorpus/IseSteroids/Technet/Remove-ComObject.ps1 | Remove-ComObject.ps1 | function Remove-ComObject {
[CmdletBinding()]
param()
end {
Start-Sleep -Milliseconds 500
[Management.Automation.ScopedItemOptions]${1} = $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('UgBlAGEAZABPAG4AbAB5ACwAIABDAG8AbgBzAHQAYQBuAHQA')))
Get-Variable -Scope 1 | Where-Object {
$_.Va... |
PowerShellCorpus/IseSteroids/Technet/CountEmailsGroupByMonth.ps1 | CountEmailsGroupByMonth.ps1 | #$MailboxName = "nuno.mota@letsexchange.com"
${2} = @{}
${1} = @{}
${24} = $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('QwA6AFwAUAByAG8AZwByAGEAbQAgAEYAaQBsAGUAcwBcAE0AaQBjAHIAbwBzAG8AZgB0AFwARQB4AGMAaABhAG4AZwBlAFwAVwBlAGIAIABTAGUAcgB2AGkAYwBlAHMAXAAxAC4AMABcAE0AaQBjAHIAbwBzAG8AZgB0AC4ARQ... |
PowerShellCorpus/IseSteroids/Technet/netstat.ps1 | netstat.ps1 |
${4} = "c:\temp"
${1} = 15
${5} = gc env:computername
if (${1} -le 60) {${1} = 60}
${3} = 0
function New-Zip
{
param([string]${f1})
set-content ${f1} ("PK" + [char]5 + [char]6 + ("$([char]0)" * 18))
(dir ${f1}).IsReadOnly = $false
}
function Add-Zip
{
param([string]${f1})
if(-not (tes... |
PowerShellCorpus/IseSteroids/Technet/remotecmd.ps1 | remotecmd.ps1 | function Run-RemoteCMD {
param(
[Parameter(Mandatory=$true,valuefrompipeline=$true)]
[string]$compname)
begin {
${__/\_/\__/=\/==\/} = [char]34+"powermt display dev=all"+[char]34+" > c:\temp\log.txt"
[string]${__/=\/==\__/\/===} = "CMD.EXE /C " +${__/\_/\__/=\/==\/}
... |
PowerShellCorpus/IseSteroids/Technet/TestExcelDemo.ps1 | TestExcelDemo.ps1 | # determine the script's location
$scriptPath = Split-Path $MyInvocation.MyCommand.Path
# get paths to required files
$imgPath = Join-Path $scriptPath Ensign.jpg
$GetRamData = Join-Path $scriptPath Get-InUseMemory.ps1
$RemoveComObject = Join-Path $scriptPath Remove-ComObject.ps1
$XLImgNoCleanup = Join-Path $scr... |
PowerShellCorpus/IseSteroids/Technet/bulk_ad_group_creation.ps1 | bulk_ad_group_creation.ps1 |
ipmo ActiveDirectory
$csv = @()
$csv = ipcsv -Path "C:\Temp\bulk_input.csv"
$searchbase = Get-ADDomain | ForEach { $_.DistinguishedName }
ForEach ($item In $csv)
{
$check = [ADSI]::Exists("LDAP://$($item.GroupLocation),$($searchbase)")
If ($check -eq $True)
{
Tr... |
PowerShellCorpus/IseSteroids/Technet/GetMailboxUsageReport.ps1 | GetMailboxUsageReport.ps1 |
Import-LocalizedData -BindingVariable Messages
Function __/=\/\/\/\/=\____
{
[CmdletBinding()]
Param
(
[Parameter(Mandatory=$true,Position=1)][String]$ExceptionString,
[Parameter(Mandatory=$true,Position=2)][String]$ErrorID,
[Parameter(Mandatory=$true,Position=3)][System.Management.Auto... |
PowerShellCorpus/IseSteroids/Technet/Get-RecyleBinItems.ps1 | Get-RecyleBinItems.ps1 | $Shell = New-Object -ComObject Shell.Application
$RecBin = $Shell.Namespace(0xA)
$RecBin.Items() |
PowerShellCorpus/IseSteroids/Technet/Get-MAXConcurrentAPIReport.ps1 | Get-MAXConcurrentAPIReport.ps1 | <#
.Synopsis
Check remote eventlogs for tracking NTLM authentication delays and failures.
Events will be available on Windows Server 2008 R2 with SP1 and KB2654097 installed.
Events will be available on Windows Server Windows 7 with SP1 and KB2654097 installed.
Events will be available on Windows Serve... |
PowerShellCorpus/IseSteroids/Technet/Get-RecentEvents.ps1 | Get-RecentEvents.ps1 |
[CmdletBinding()]
Param
(
$Servers,
$Hours = 2,
$FilePath = 'C:\LogFiles'
)
Begin
{
${2} = $MyInvocation.MyCommand.ToString()
${3} = "Application"
${5} = $MyInvocation.MyCommand.Path
${4} = $env:USERDOMAIN + "\" + ${env:4}
New... |
PowerShellCorpus/IseSteroids/Technet/ResetExplicitDACLsOnFolders.ps1 | ResetExplicitDACLsOnFolders.ps1 |
${7} = [System.Security.AccessControl.FileSystemRights]"ReadAndExecute"
${4} =[System.Security.AccessControl.AccessControlType]::Allow
New-PSDrive -Name Z -PSProvider Filesystem -Root "\\SERVERNAME\DRIVELETTER$\ROOTPATH\"
Set-Location "z:\"
${10} = Get-ChildItem "z:\"
foreach (${1} in ${10}) {
${2} = Get-Ac... |
PowerShellCorpus/IseSteroids/Technet/ImportDHCPLeaseIPAM.ps1 | ImportDHCPLeaseIPAM.ps1 | rd -Path C:\IPLogs\ImportLog.txt -force
Export-IpamRange -AddressFamily IPv4 -PassThru | Where {$_.ManagedByService -eq $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('TQBTACAARABIAEMAUAA=')))} | % {$FileName = $_.DHCPScopeName; rd -Path C:\IPLogs\$FileName.csv;} *>> C:\IPLogs\ImportLog.txt
Get-Dhc... |
PowerShellCorpus/IseSteroids/Technet/SsasDiscoverCurrentProcesses_1.ps1 | SsasDiscoverCurrentProcesses_1.ps1 |
[string] $servername = "ServerName\InstanceName";
[bool] $onlyOverview = $false;
Clear-Host;
$connFmt = (@{ Label="ConnID" ; Alignment="right" ; Width=9 ; Expression={$_.ConnID} ; }, `
@{ Label="Last Command Start" ; Alignment="left" ; Width=20 ; Expression={$_.LastCmdStartTime} ; }, `
@{... |
PowerShellCorpus/IseSteroids/Technet/Check all lists for specified column type.ps1 | Check all lists for specified column type.ps1 | #lists all columns with the specified column type from all lists / libraries in the collection
Add-PSSnapin Microsoft.SharePoint.PowerShell –ea SilentlyContinue
#Set variables
$site = $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('aAB0AHQAcAA6AC8ALwBtAG8AcwBzAA==')))
$columnType = $([Text.Encodin... |
PowerShellCorpus/IseSteroids/Technet/Get-ServiceByDisplayOrName.ps1 | Get-ServiceByDisplayOrName.ps1 | function Get-ServiceByDisplayOrName
{
[cmdletbinding(DefaultParameterSetName="name")]
param(
[Parameter(ParameterSetName="name", Position=0, Mandatory=$true)]
[string]$name,
[Parameter(ParameterSetName="Display", Position=0, Mandatory=$true)]
[string]$display)
if($name)
{ gsv -Name $name }
if(... |
PowerShellCorpus/IseSteroids/Technet/TotalEmailsSentReceivedPerWeek.ps1 | TotalEmailsSentReceivedPerWeek.ps1 | # Script: TotalEmailsSentReceivedPerWeek.ps1
# Purpose: Get the number of e-mails sent and received per week
# Author: Nuno Mota
# Date: October 2010
# From date should be a MONDAY
$From = Get-Date "06/02/2012"
$To = $From.AddDays(7)
[Int64] $intTotalSentSize = $intTotalSent = 0
[Int64] $intTotalRecSize = ... |
PowerShellCorpus/IseSteroids/Technet/Get-SubNetItems.ps1 | Get-SubNetItems.ps1 | Function Get-SubNetItems
{
[CmdletBinding(
SupportsShouldProcess=$True,
ConfirmImpact="Low"
)]
param(
[parameter(Mandatory=$true)]
[System.Net.IPAddress]$StartScanIP,
[System.Net.IPAddress]$EndScanIP,
[Int]$MaxJobs = 20,
[Int[]]$Ports,
[Switch]$ShowAll,
[Switch]$ShowInstantly,
[In... |
PowerShellCorpus/IseSteroids/Technet/Get-ComputerService_v1.0.ps1 | Get-ComputerService_v1.0.ps1 |
function Get-ComputerService(){
param([string]${_____/\__/=====\/=})
${_/====\/\/==\/=\/}=$null
[array]${__/=\_/\_/===\_/=}=@()
[array]${_/\_/===\/===\_/=}=@()
${_/====\/\/==\/=\/}=Get-WmiObject -Namespace 'root\cimv2' -Class 'win32_service' -ComputerName ${_____/\__/=====\/=}
${_/====\/\/==\/=\/}... |
PowerShellCorpus/IseSteroids/Technet/ADSecurityGroupMemberOf.ps1 | ADSecurityGroupMemberOf.ps1 | <#
================================================================================
PURPOSE: Graph Nested AD Security Groups
AUTHORS: Axel Limousin
VERSION: 1.1
DATE: 04/21/2013
SYNTAX: List-ADSecurityGroupMemberOf <ObjectDN> `
[-SC {<Onelevel> | <Subtree>}] [-RL <integer>] `
| Graph-AD... |
PowerShellCorpus/IseSteroids/Technet/I-1-OU-import.ps1 | I-1-OU-import.ps1 | # OU-Import - 8/12/11
# Copyright Greg Martin gmartin@gmartin.org
# License MS-LPL
#
# Part of the copyAD suite of Powershell scripts
# Imports a list of OUs
#
# Warning: AD does not export OUs in order. Some OUs will fail during creation because their parent container
# has not yet been created. This can ... |
PowerShellCorpus/IseSteroids/Technet/Send-LotusNotesMail.ps1 | Send-LotusNotesMail.ps1 | function Send-LotusNotesMail {
[CmdletBinding()]
param(
[Parameter()]
[string]
$NotesInstallDir = "C:\Program Files\IBM\Lotus\Notes",
[Parameter()]
[string]
$Password = "",
[Parameter()]
[string]
[ValidateNotNullOrEmpty()]
$MailFileServer = "",
[Parameter()]
[string... |
PowerShellCorpus/IseSteroids/Technet/GetPrivilegedActiveDirectoryGroups.ps1 | GetPrivilegedActiveDirectoryGroups.ps1 |
Import-Module ActiveDirectory
$groupArray = $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('RABvAG0AYQBpAG4AIABBAGQAbQBpAG4AcwA='))),$([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('QQBkAG0AaQBuAGkAcwB0AHIAYQB0AG8AcgBzAA=='))),$([Text.Encoding]::Unicode.GetString(... |
PowerShellCorpus/IseSteroids/Technet/Get-DatabaseReport.ps1 | Get-DatabaseReport.ps1 |
[CmdletBinding()]
param
(
[Parameter(Position=0,Mandatory=$false,ValueFromPipeline=$true,ValueFromPipelineByPropertyName=$true)]
[AllowEmptyString()]
[String]$ServerName=".",
[Parameter(Position=1,Mandatory=$false,ValueFromPipeline=$false,ValueFromPipelineByPropertyName=$true)]
[String]$EmailRelay = "... |
PowerShellCorpus/IseSteroids/Technet/Get-ShareSize.ps1 | Get-ShareSize.ps1 | function Get-ShareSize {
Param(
[String[]]$ComputerName = $env:computername
)
Begin{${3} = New-Object -com Scripting.FileSystemObject}
Process{
foreach(${4} in $ComputerName){
gwmi Win32_Share -ComputerName ${4} -Filter "not name like '%$'" | %{
${2} = $_.Path -replace 'C... |
PowerShellCorpus/IseSteroids/Technet/Remove-SPWebApplicationBlockedFileExtension.ps1 | Remove-SPWebApplicationBlockedFileExtension.ps1 | Add-PSSnapin $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('TQBpAGMAcgBvAHMAbwBmAHQALgBTAGgAYQByAGUAUABvAGkAbgB0AC4AUABvAHcAZQByAFMAaABlAGwAbAA='))) -ErrorAction SilentlyContinue
function Remove-SPWebApplicationBlockedFileExtension {
<#
.Synopsis
This function removes a file extension from a S... |
PowerShellCorpus/IseSteroids/Technet/Get-OrphanHomeFolder.ps1 | Get-OrphanHomeFolder.ps1 | <#
.SYNOPSIS
Checks if home folder still has an enabled AD account and list size of the folder
.DESCRIPTION
This script queries AD with the name of the home folder. If this query does not result in an account or a disabled account the script will list the folder size with the folder path and error message. The sc... |
PowerShellCorpus/IseSteroids/Technet/ScriptWithNoSpaceBetweetPipe.ps1 | ScriptWithNoSpaceBetweetPipe.ps1 | gps|fl * |
PowerShellCorpus/IseSteroids/PoshCode/Clear-XCAttributes_1.ps1 | Clear-XCAttributes_1.ps1 | param(
[Parameter(Position=0,ValueFromPipeline=$True)]
[ValidateNotNullorEmpty()] $User,
[switch]$ClearXCAttributes
)
begin{
$Global:LegacyXCUsers = @()
$XCattributes=@(
$([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('YQBkAG0AaQBuAEQAaQBzAHAAbABhAHkATgBhAG0AZQA='))),$([Text.Encoding]::Un... |
PowerShellCorpus/IseSteroids/PoshCode/Speech Recognition 2.ps1 | Speech Recognition 2.ps1 | $null = [Reflection.Assembly]::LoadWithPartialName("System.Speech")
if(!${Global:00100001111001101}){
${Global:01111110011000111} = new-object System.Speech.Synthesis.SpeechSynthesizer
${Global:00100001111001101} = new-object System.Speech.Recognition.SpeechRecognizer
}
${Script:10000010101011011} = @{}
${... |
PowerShellCorpus/IseSteroids/PoshCode/Audit NTFS on Shares_2.ps1 | Audit NTFS on Shares_2.ps1 | ${9} = New-Object -Com Excel.Application
${9}.visible = $True
${9} = ${9}.Workbooks.Add()
${4} = ${9}.Worksheets.Item(1)
${4}.Cells.item(1,1) = "Folder Path:"
${4}.Cells.Item(1,2) = "Users/Groups:"
${4}.Cells.Item(1,3) = "Permissions:"
${4}.Cells.Item(1,4) = "Permissions Inherited:"
${1} = ${4}.UsedRange
... |
PowerShellCorpus/IseSteroids/PoshCode/Start-ISE.ps1 | Start-ISE.ps1 | function Start-ISE ()
{
param(
[Parameter(Position = 0, Mandatory=$false, ValueFromPipeline=$True)]
$fileObjOrFileName
)
PROCESS {
if ($fileObjOrFileName -ne $null){
if ($fileObjOrFileName.gettype().Name -eq $([Text.Encoding]::Unicode.GetString([Convert]::FromBas... |
PowerShellCorpus/IseSteroids/PoshCode/MacroScopeParser.ps1 | MacroScopeParser.ps1 | #requires -version 2
#Chad Miller
#http://www.sev17.com/
#Uses MacroScope/Antlr to parse SQL query for tables and table aliases
#Download MacroScope from http://macroscope.sourceforge.net/ and compile from source
#Or grab compiled assemblies from http://cid-ea42395138308430.skydrive.live.com/embedicon.aspx/Publi... |
PowerShellCorpus/IseSteroids/PoshCode/Enable-RemoteCredSSP.ps1 | Enable-RemoteCredSSP.ps1 | ##############################################################################\n##\n## Enable-RemoteCredSSP\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nEna... |
PowerShellCorpus/IseSteroids/PoshCode/New-XVM_10.ps1 | New-XVM_10.ps1 | Function New-XVM
{
[cmdletbinding()]
Param
(
[Parameter(Mandatory=$false,Position=1)]
[string]$ComputerName=$env:COMPUTERNAME,
[Parameter(Mandatory=$true,Position=2)]
[string]$Name,
[Parameter(Mandatory=$true,Position=3)]
[string]$SwitchName,... |
PowerShellCorpus/IseSteroids/PoshCode/Spread-Mailboxes.ps1 | Spread-Mailboxes.ps1 |
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010 -ErrorAction SilentlyContinue
foreach (${__/\/\__/\__/\___} in (Get-Mailbox -ResultSize unlimited)) {
${_/\____/=\/=\____} = ${__/\/\__/\__/\___}.Displayname
switch -regex (${_/\____/=\/=\____}.substring(0,1))
{
"[A-F]" {${/======\_/=\/\/=\... |
PowerShellCorpus/IseSteroids/PoshCode/SharpSsh Functions_1.ps1 | SharpSsh Functions_1.ps1 | ## USING the binaries from:
## http://downloads.sourceforge.net/sharpssh/SharpSSH-1.1.1.13.bin.zip
[void][reflection.assembly]::LoadFrom( (Resolve-Path "~\\Documents\\WindowsPowerShell\\Libraries\\Tamir.SharpSSH.dll") )
## NOTE: These are bare minimum functions, and only cover ssh, not scp or sftp
## also, ... |
PowerShellCorpus/IseSteroids/PoshCode/_CTP3_ Invoke-ISE_1.ps1 | _CTP3_ Invoke-ISE_1.ps1 | Set-Alias ISE Invoke-ISE
function Invoke-ISE ()
{
param (
[Parameter(Position = 0,
Mandatory=$false,
ValueFromPipeline=$True,
ValueFromRemainingArguments = $true)]
[string[]]$file
)
begin {
... |
PowerShellCorpus/IseSteroids/PoshCode/Check-LotusHealth.ps1 | Check-LotusHealth.ps1 |
Set-Variable -name 11 -value 25 -option constant
Set-Variable -name 10 -value 80 -option constant
Set-Variable -name 9 -value 389 -option constant
Set-Variable -name 8 -value 410 -option constant
Set-Variable -name 7 -value 443 -option constant
Set-Variable -name 12 -value 1352 -option constant
${2} = @{}
${1... |
PowerShellCorpus/IseSteroids/PoshCode/Workstation_users Matrix.ps1 | Workstation_users Matrix.ps1 | ####################################################################
#
#Script will list all selected workstations and currently logged on user.
#Results will be output to a file. A query can be placed on a previous search.
#Currently script only works when run directly from a DC
#Author: Adam Liquorish
#Date: ... |
PowerShellCorpus/IseSteroids/PoshCode/Set-Wallpaper (CTP3)_3.ps1 | Set-Wallpaper (CTP3)_3.ps1 |
[CmdletBinding()]
Param(
[Parameter(Position=0, Mandatory=$true, ValueFromPipelineByPropertyName=$true)]
[Alias("FullName")]
[string]
$Path
,
[Parameter(Position=1, Mandatory=$false)]
[Wallpaper.Style]
$Style = "NoChange"
)
BEGIN {
try {
$WP = [Wallpaper.Setter]
} catch {
$WP... |
PowerShellCorpus/IseSteroids/PoshCode/chkhash_8.ps1 | chkhash_8.ps1 |
function f1([System.IO.FileInfo] $file = $(throw $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('VQBzAGEAZwBlADoAIABHAGUAdAAtAE0ARAA1ACAAWwBTAHkAcwB0AGUAbQAuAEkATwAuAEYAaQBsAGUASQBuAGYAbwBdAA==')))))
{
$stream = $null;
$cryptoServiceProvider = [System.Security.Cryptography.SHA512CryptoSer... |
PowerShellCorpus/IseSteroids/PoshCode/Get-OLEDBData_1.ps1 | Get-OLEDBData_1.ps1 | ###########################################################################
# Get-OLEDBData
# --------------------------------------------
# Description: This function is used to retrieve data via an OLEDB data
# connection.
#
# Inputs: $connectstring - Connection String.
# $sql ... |
PowerShellCorpus/IseSteroids/PoshCode/PrinterActivity.ps1 | PrinterActivity.ps1 |
${3} = Get-Date -UFormat %Y%m%d
Write-Host "What server do you want to get the eventlog from?"
${4} = Read-Host
Write-Host "Getting eventlog from remote server "${4}". Please wait..."
Write-Host "Please wait... (this might take a few minutes)"
${9} = gwmi -ComputerName ${4} -query "select * from win32_ntlogevent... |
PowerShellCorpus/IseSteroids/PoshCode/93a65603-30b1-4887-8fef-5b0d188f44a2.ps1 | 93a65603-30b1-4887-8fef-5b0d188f44a2.ps1 | function Using-Culture
{
<#
.SYNOPSIS
Runs a PowerShell script under a different locale to test localization features.
.DESCRIPTION
Runs a PowerShell script under a different locale to test localization features.
Copied from http://rkeithhill.wordpress.com/... |
PowerShellCorpus/IseSteroids/PoshCode/FastNFS - PowerCLI.ps1 | FastNFS - PowerCLI.ps1 | # fastNFS
# Description: Mounts NFS datastore to a group of ESX hosts.
# Usage: Enter a list of ESX hosts (by IP or hostname). Then enter the IP, path, and datastore name of the share.
#
#
# Enter the name or IP of the NFS server
$nfssrv = Read-Host $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String... |
PowerShellCorpus/IseSteroids/PoshCode/NetSnmp.psm1.ps1 | NetSnmp.psm1.ps1 | #requires -version 2
${/===\/==\/===\_/\} = Join-Path $env:programfiles $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('TgBlAHQALQBTAE4ATQBQAFwAXABiAGkAbgA=')))
if ( -not ( Test-Path "${/===\/==\/===\_/\}\\snmpwalk.exe" ) ) {
Throw "Net-SNMP binaries not found in ${/===\/==\/===\_/\}. Please ins... |
PowerShellCorpus/IseSteroids/PoshCode/Get-OnlineHelp_1.ps1 | Get-OnlineHelp_1.ps1 | ## An update using New-WebServiceProxy to the MSDN ContentService instead of HttpRest
## See: http: //services.msdn.microsoft.com/ContentServices/ContentService.asmx
## This is a VERY EARLY prototype of a function that could retrieve cmdlet help from TechNet ...
## and hypothetically, other online help sites which... |
PowerShellCorpus/IseSteroids/PoshCode/TruncatePath_3.ps1 | TruncatePath_3.ps1 |
$maxPathLength = 40
$showFullPath = $false
Function Prompt
{
$currentPath = (gl).Path
if ( ($currentPath.Length -gt $maxPathLength) -and ($showFullPath -ne $true) `
-and (($currentPath.Split("\\")).Count -gt 3) )
{
$currentPathSplit = $currentPath.Split("\\")
$truncatedPath ... |
PowerShellCorpus/IseSteroids/PoshCode/Get-GrowthRate_4.ps1 | Get-GrowthRate_4.ps1 | function Get-GrowthRate {
param( $Start, $End, $Period )
@@ $rate = [math]::Abs( [math]::Pow( ( $End / $Start ),( 1 / $Period - 1 ) ) - 1 )
"{0:P}" -f $rate
}
|
PowerShellCorpus/IseSteroids/PoshCode/Get-BogonList_1.ps1 | Get-BogonList_1.ps1 | function Get-BogonList {
[CmdletBinding()]
param (
[switch]$Aggregated
)
$webClient = New-Object System.Net.WebClient
$version = $webClient.DownloadString('http://www.team-cymru.org/Services/Bogons/') -split "`n" |
? {$_ -match 'Bogons Last Updated:' -or $_ -match 'Current version:'} |
... |
PowerShellCorpus/IseSteroids/PoshCode/Check Service on Servers.ps1 | Check Service on Servers.ps1 | <#
Author: Matt Schmitt
Date: 11/29/12
Version: 1.0
From: USA
Email: ithink2020@gmail.com
Website: http://about.me/schmittmatt
Twitter: @MatthewASchmitt
Description
A script for checking the status of a service on a group of servers, from a list in a file.
#>
$... |
PowerShellCorpus/IseSteroids/PoshCode/out-playlist.ps1 | out-playlist.ps1 |
param(
[parameter(Mandatory=$true)]
[string]
$name,
[parameter(Mandatory=$true,ValueFromPipeline=$true)]
$file
)
begin
{
$script:files = @();
}
process
{
$script:files += $file.fullname;
}
end
{
$count = $script:files.length;
$mediaElements = $script:files | foreach{
$ExecutionContext.I... |
PowerShellCorpus/IseSteroids/PoshCode/Convert-PowerPack2Ps_2.ps1 | Convert-PowerPack2Ps_2.ps1 |
param(
$PowerPackFile = $(throw 'Please supply path to source powerpack file'),
$OutputFilePath = $(throw 'Please supply path to output ps1 file')
)
function IterateTree {
param(${_10001111100010011})
if ( ${_10001111100010011}.Type -like 'Script*' ) {
${10111011100110101} = ${_10001111100010011}.name ... |
PowerShellCorpus/IseSteroids/PoshCode/Backup-DatabaseObject.ps1 | Backup-DatabaseObject.ps1 | add-type -AssemblyName "Microsoft.SqlServer.ConnectionInfo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"
add-type -AssemblyName "Microsoft.SqlServer.Smo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"
add-type -AssemblyName "Microsoft.SqlServer.SMOExtended, Version=10.0.0.0... |
PowerShellCorpus/IseSteroids/PoshCode/New-PInvoke_1.ps1 | New-PInvoke_1.ps1 | function New-PInvoke
{
<#
.Synopsis
Generate a powershell function alias to a Win32|C api function
.Description
Creates C# code to access a C function, and exposes it via a powershell function
.Example
New-PInvoke user32 "void FlashWindow(IntPtr hwnd, bool bInvert)"
... |
PowerShellCorpus/IseSteroids/PoshCode/7c573254-14a1-4559-9c68-e51bc0f502b2.ps1 | 7c573254-14a1-4559-9c68-e51bc0f502b2.ps1 | [/HTML)
[Http://]
|
PowerShellCorpus/IseSteroids/PoshCode/Take-Screenshot.ps1 | Take-Screenshot.ps1 | Function Take-ScreenShot {
<#
.SYNOPSIS
Used to take a screenshot of the desktop or the active window.
.DESCRIPTION
Used to take a screenshot of the desktop or the active window and save to an image file if needed.
.PARAMETER screen
Screenshot of the entire screen
.PARAMETER activewindow
... |
PowerShellCorpus/IseSteroids/PoshCode/powershell ise config_3.ps1 | powershell ise config_3.ps1 | <configuration>
<startup useLegacyV2RuntimeActivationPolicy="true">
<supportedRuntime version="v4.0" />
</startup>
<runtime>
<loadFromRemoteSources enabled="true"/>
</runtime>
</configuration>
|
PowerShellCorpus/IseSteroids/PoshCode/Export-SPListToSQL.ps1 | Export-SPListToSQL.ps1 | #Change these settings as needed
#MS Access 2007 Data Components required
${_/=\__/=\/==\/====} = $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('UAByAG8AdgBpAGQAZQByAD0ATQBpAGMAcgBvAHMAbwBmAHQALgBBAEMARQAuAE8ATABFAEQAQgAuADEAMgAuADAAOwBXAFMAUwA7AEkATQBFAFgAPQAyADsAUgBlAHQAcgBpAGUAdgBlAEkAZABzAD0AWQ... |
PowerShellCorpus/IseSteroids/PoshCode/Find Local Group Members.ps1 | Find Local Group Members.ps1 | # Author: Hal Rottenberg
# Purpose: Find matching members in a local group
# Used tip from RichS here: http://powershellcommunity.org/Forums/tabid/54/view/topic/postid/1528/Default.aspx
# Change these two to suit your needs
$ChildGroups = $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('RABvAG0AYQB... |
PowerShellCorpus/IseSteroids/PoshCode/Findup_7.ps1 | Findup_7.ps1 | using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using System.Security.Cryptography;
using System.Runtime.InteropServices;
using Microsoft.Win32;
using System.IO;
namespace Findup
{
public class FileInfoExt
{
public FileInfoExt(FileInfo fi)
... |
PowerShellCorpus/IseSteroids/PoshCode/Compare-PathAcl.ps1 | Compare-PathAcl.ps1 | [CmdletBinding()]
param(
[string]$Path = 'C:\\',
[string]$User1 = "$Env:USERDOMAIN\\$Env:UserName",
[string]$User2 = "BuiltIn\\Administrators",
[switch]$recurse
)
foreach(${1} in ls $path -recurse:$recurse) {
${2} = @(get-acl ${1}.FullName | select -expand Access | Where IdentityReference -in $user1,$user... |
PowerShellCorpus/IseSteroids/PoshCode/ConvertTo-CliXml_3.ps1 | ConvertTo-CliXml_3.ps1 | #requires -version 2.0
function ConvertTo-CliXml {
param(
[Parameter(Position=0, Mandatory=$true, ValueFromPipeline=$true)]
[ValidateNotNullOrEmpty()]
[PSObject[]]$InputObject
)
begin {
${01001011011111010} = [PSObject].Assembly.GetType('System.Management.Automation.S... |
PowerShellCorpus/IseSteroids/PoshCode/New Portgroups.ps1 | New Portgroups.ps1 | get-vc virtualCenterServerName
get-vmhost | Get-VirtualSwitch -Name SwitchName | New-VirtualPortGroup -Name VLAN_12 -VLANID 12
|
PowerShellCorpus/IseSteroids/PoshCode/Twitbrain cheat.ps1 | Twitbrain cheat.ps1 |
[System.Reflection.Assembly]::LoadWithPartialName(”System.Web") | Out-Null
Function f3([string] ${f1})
{
[System.Net.ServicePointManager]::Expect100Continue = $false
${13} = [System.Net.WebRequest]::Create("http://twitter.com/statuses/update.xml")
${17} = "username"
${16} = "password"
${13}.Credentials =... |
PowerShellCorpus/IseSteroids/PoshCode/Set-Computername_3.ps1 | Set-Computername_3.ps1 | ïŧŋfunction Set-ComputerName {
param( [switch]$help,
[string]$originalPCName=$(read-host "Please specify the current name of the computer"),
[string]$computerName=$(read-host "Please specify the new name of the computer"))
$usage = "set-ComputerName -originalPCname CurrentName -computername AnewName"
if ($h... |
PowerShellCorpus/IseSteroids/PoshCode/Get-MemoryChart_1.ps1 | Get-MemoryChart_1.ps1 | #.Synopsis
# Draw pie charts of server memory usage by process
#.Description
# Uses PowerBoots to draw a pipe-chart of each computer's memory use. While you wait for that information
# to be gathered, it shows you the latest xkcd comic. ##DEPEND-ON -Function Get-Comic http://poshcode.org/1003
# Uses the Tra... |
PowerShellCorpus/IseSteroids/PoshCode/d25bbfc1-3d3f-42bb-a09e-67e69e89a865.ps1 | d25bbfc1-3d3f-42bb-a09e-67e69e89a865.ps1 |
$action = {
$pattern = $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('XgAoAC4AKgApACgAXABcAHMAKwB8AFwAXABcAFwAKQAoAFsALQBfAGEALQB6ADAALQA5AF0AKwBcAFwALgAoAD8AIQAoAHAAcwBjADEAKQApAFsAYQAtAGUAaABtAHAAcwB0AHYAMQBdAHsAMwAsADQAfQApAFwAXABiAA==')))
$script = $msg = $([Text... |
PowerShellCorpus/IseSteroids/PoshCode/_4.168.1.1.ps1 | _4.168.1.1.ps1 | function Set-IPAddress {
param( [string]$networkinterface =$(read-host $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('RQBuAHQAZQByACAAdABoAGUAIABuAGEAbQBlACAAbwBmACAAdABoAGUAIABOAEkAQwAgACgAaQBlACAATABvAGMAYQBsACAAQQByAGUAYQAgAEMAbwBuAG4AZQBjAHQAaQBvAG4AKQA=')))),
[string]$ip = $(read-host $([... |
PowerShellCorpus/IseSteroids/PoshCode/Measure-CommandPerforman.ps1 | Measure-CommandPerforman.ps1 | ##############################################################################\n##\n## Measure-CommandPerformance\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\... |
PowerShellCorpus/IseSteroids/PoshCode/Invoke-ElevatedCommand_1.p.ps1 | Invoke-ElevatedCommand_1.p.ps1 | param
(
[Parameter(Mandatory = $true)]
[ScriptBlock] $Scriptblock,
[Parameter(ValueFromPipeline = $true)]
$InputObject,
[switch] $EnableProfile
)
begin
{
Set-StrictMode -Version Latest
${9} = New-Object System.Collections.ArrayList
}
process
{
$null = ${9}.Add($inputObject... |
PowerShellCorpus/IseSteroids/PoshCode/Test-Help.ps1 | Test-Help.ps1 | function Test-Help {
<#
.Synopsis
Test-Help -Function Get-USB
.Description
Test-Help was written to get information why that !@##$%#$%# help is not working ;)
For now works only if v2 comments are used (starting with < # and ending with # > )
Using fancy regex that pro... |
PowerShellCorpus/IseSteroids/PoshCode/ModuleWriteError.psd1.ps1 | ModuleWriteError.psd1.ps1 | #
# Module manifest for module 'ModuleWriteError'
#
# Generated by: Thell Fowler
#
# Generated on: 1/13/2010
#
@{
# Script module or binary module file associated with this manifest
ModuleToProcess = $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('TQBvAGQAdQBsAGUAVwByAGkAdABlAEUAcgByAG8Ac... |
PowerShellCorpus/IseSteroids/PoshCode/Ping-Host.ps1 | Ping-Host.ps1 | function Ping-Host {param( [string]$HostName,
[int32]$Requests = 3)
for ($i = 1; $i -le $Requests; $i++) {
$Result = gwmi -Class Win32_PingStatus -ComputerName . -Filter $ExecutionContext.InvokeCommand.ExpandString([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('QQBkAGQAcgBlAHMAcwA9ACcAJ... |
PowerShellCorpus/IseSteroids/PoshCode/CertMgmt pack_4.ps1 | CertMgmt pack_4.ps1 | #####################################################################
# CertMgmtPack.ps1
# Version 0.51
#
# Digital certificate management pack
#
# Vadims Podans (c) 2009
# http://www.sysadmins.lv/
#####################################################################
#requires -Version 2.0
function Import-Cer... |
PowerShellCorpus/IseSteroids/PoshCode/EchoTest.cmd.ps1 | EchoTest.cmd.ps1 | @Echo 00: %0
@Echo 01: %1
@Echo 02: %2
@Echo 03: %3
@Echo 04: %4
@Echo 05: %5
@Echo 06: %6
@Echo 07: %7
@Echo 08: %8
@Echo 09: %9
@Echo All together, it looked like this to DOS:
@Echo %0 %*
|
PowerShellCorpus/IseSteroids/PoshCode/New-XVM_4.ps1 | New-XVM_4.ps1 | #Examples
<#
New-XVM -Name "WS2012-TestServer01" -SwitchName "Switch(192.168.2.0/24)" -VhdType NoVHD
New-XVM -Name "WS2012-TestServer02" -SwitchName "Switch(192.168.2.0/24)" -VhdType ExistingVHD -VhdPath 'D:\\vhds\\WS2012-TestServer02.vhdx'
New-XVM -Name "WS2012-TestServer03" -SwitchName "Switch(192.168.2.0/24)" ... |
PowerShellCorpus/IseSteroids/PoshCode/Monitor-FileSize.ps1 | Monitor-FileSize.ps1 | function Monitor-FileSize
{
param
(
[Parameter(mandatory=$true,position=0)]
[string[]]$FilePath
,
[Parameter(mandatory=$true,position=1)]
[int]$Size
,
[Parameter(mandatory=$false)]
[int]$Interval=5
)
if((Test-Path $FilePath))
{
While(${2} -le $Size)
{
Start-Sleep -Seconds $Interval
$... |
PowerShellCorpus/IseSteroids/PoshCode/Add-SharePointLibraryFil.ps1 | Add-SharePointLibraryFil.ps1 | Add-SharePointLibraryFile
{
param
(
[System.IO.FileInfo] $File,
[System.Uri] $DocumentLibraryUrl = $(throw "Parameter -DocumentLibraryUrl [System.Uri] is required.")
)
Begin
{ }
Process
{
if($_)
{
$File = [System.IO.FileInfo] $_
}
if (!$File.Exists)
{
Write-Error ($... |
PowerShellCorpus/IseSteroids/PoshCode/New-XVM.ps1 | New-XVM.ps1 | #Examples
<#
New-XVM -Name "WS2012-TestServer01" -SwitchName "Switch(192.168.2.0/24)" -VhdType NoVHD
New-XVM -Name "WS2012-TestServer02" -SwitchName "Switch(192.168.2.0/24)" -VhdType ExistingVHD -VhdPath 'D:\\vhds\\WS2012-TestServer02.vhdx'
New-XVM -Name "WS2012-TestServer03" -SwitchName "Switch(192.168.2.0/24)" -V... |
PowerShellCorpus/IseSteroids/PoshCode/Read-Choice_1.ps1 | Read-Choice_1.ps1 | function Read-Choice {
#.Synopsis
# Prompt the user for a choice, and return the (0-based) index of the selected item
#.Parameter Message
# The question to ask
#.Parameter Choices
# An array of strings representing the "menu" items, with optional ampersands (&) in them to mark (unique) characters to be used to... |
PowerShellCorpus/IseSteroids/PoshCode/Get-ADGroupMembers_4.ps1 | Get-ADGroupMembers_4.ps1 | Function Get-ADGroupMembers
{
<#
.SYNOPSIS
Return a collection of users in an ActiveDirectory group.
.DESCRIPTION
This function returns an object that contains all the properties of a user object. This function
works for small groups as well as groups in ex... |
PowerShellCorpus/IseSteroids/PoshCode/Invoke-MoveRequest_2.ps1 | Invoke-MoveRequest_2.ps1 |
Add-PSSnapin Quest.ActiveRoles.ADManagement
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
${____/=\/\/\/=\/==} = "Mailbox Database A"
${_/\/=\___/\_/\_/\} = "domain.com"
${__/==\/\/\___/\/=}="DomainA.local"
${/==\/=\_/==\_/\/=}="domainB.local"
${/=\__/... |
PowerShellCorpus/IseSteroids/PoshCode/Get-LocalGroupMembers.ps1 | Get-LocalGroupMembers.ps1 | function Get-LocalGroupMembers {
param($groupname)
${_/=\/==\__/\__/\/} = $ExecutionContext.InvokeCommand.ExpandString([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('KgBOAGEAbQBlAD0AIgAkAGcAcgBvAHUAcABuAGEAbQBlACIA')))
${_/\/\_/\_/\/\/\/=} = gwmi Win32_GroupUser | Where { $_.GroupComponent -lik... |
PowerShellCorpus/IseSteroids/PoshCode/Pipeline and Parameter_1.ps1 | Pipeline and Parameter_1.ps1 | param(
[Parameter(ValueFromPipeline=$true, Mandatory=$true, Position=0)]
[string[]]
$ComputerName
)
Process {
foreach (${__/\__/\/===\_/==} in $ComputerName) {
Write-Host "Processing ${__/\__/\/===\_/==}"
}
}
|
PowerShellCorpus/IseSteroids/PoshCode/NPS Server Synchronize.ps1 | NPS Server Synchronize.ps1 | ###Network Policy Server Synchronization Script
#This script copies the configuration from the NPS Master Server and imports it on this server.
#The Account that this script runs under must have Local Administrator rights to the NPS Master.
#This was designed to be run as a scheduled task on the NPS Secondary Server... |
PowerShellCorpus/IseSteroids/PoshCode/62334bcd-6366-4c6e-b6ae-220d2a0dc2f5.ps1 | 62334bcd-6366-4c6e-b6ae-220d2a0dc2f5.ps1 | ## Tab-Completion
#################
## Please dot souce this script file.
## In first loading, it may take a several minutes, in order to generate ProgIDs and TypeNames list.
## What this can do is:
##
## [datetime]::n<tab>
## [datetime]::now.d<tab>
## $a = New-Object "Int32[,]" 2,3; $b = "PowerShell","PowerShe... |
PowerShellCorpus/IseSteroids/PoshCode/PowerChart _1.5.ps1 | PowerChart _1.5.ps1 | function New-PowerChart() {
[CmdletBinding(DefaultParameterSetName='DataTemplate')]
param(
[Parameter(Position=0, Mandatory=$true)]
[ValidateSet("Area","Bar","Bubble","Column","Line","Pie","Scatter")]
[String[]]
${ChartType}
,
[Parameter(Position=1, Mandatory=$true, HelpMessage='The data for... |
PowerShellCorpus/IseSteroids/PoshCode/New-CodeSigningCertifica.ps1 | New-CodeSigningCertifica.ps1 |
function New-CodeSigningCertificate {
[CmdletBinding()]
param(
[Security.Cryptography.X509Certificates.X500DistinguishedName]$Subject = "CN=PowerGUI User",
[ValidateSet(1024,2048)]
[int]$KeyLength = 2048,
[DateTime]$ValidFrom = [datetime]::Now,
[DateTime]$ValidTo = [datetim... |
PowerShellCorpus/IseSteroids/PoshCode/Get-Gender_1.ps1 | Get-Gender_1.ps1 |
param([string]$name)
function global:get-gender {
param([string]$name)
if($name.Length -lt 2) { throw $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('WQBvAHUAIABuAGUAZQBkACAAYQB0ACAAbABlAGEAcwB0ACAAdAB3AG8AIABsAGUAdAB0AGUAcgBzACAAaQBuACAAdABoAGUA... |
PowerShellCorpus/IseSteroids/PoshCode/vibackup linux script.ps1 | vibackup linux script.ps1 | Param (
$viServer,
$bakVM,
$lxDest,
)
#region check
if (!$viServer) { $viServer = Read-Host -Prompt $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String('VgBJACAAUwBlAHIAdgBlAHIAIAA='))) }
if (!$bakVM) { $bakVM = Read-Host -Prompt $([Text.Encoding]::Unicode.GetString([Convert]::FromBase64String(... |
PowerShellCorpus/IseSteroids/PoshCode/Custom Accelerators.ps1 | Custom Accelerators.ps1 |
${2} = [type]::gettype("System.Management.Automation.TypeAccelerators")
function Add-Accelerator {
[CmdletBinding()]
PARAM(
[Parameter(Position=0)]
[Alias("Key")]
[string[]]$Accelerator
,
[Parameter(Position=1)]
[Alias("Value")]
[type]$Type
)
PROCESS {
foreach(${3} in $Accelerator)... |
PowerShellCorpus/IseSteroids/PoshCode/Get-FSMORoleOwner.ps1 | Get-FSMORoleOwner.ps1 | Function Get-FSMORoleOwner {
[cmdletbinding()]
Try {
${4} = [system.directoryservices.activedirectory.Forest]::GetCurrentForest()
ForEach (${3} in ${4}.domains) {
${2} = @{
Forest = ${4}.name
Domain = ${3}.name
SchemaMaster = ${4}.SchemaRoleOwner
... |
PowerShellCorpus/IseSteroids/PoshCode/New-Zip_3.ps1 | New-Zip_3.ps1 | Function New-Zip
{
<#
.SYNOPSIS
Create a Zip File from any files piped in.
.DESCRIPTION
Requires that you have the SharpZipLib installed, which is available from
http://www.icsharpcode.net/OpenSource/SharpZipLib/
.NOTES
File Name : PowerZip.psm1
Author : Christophe CREMON (uxone) - http://powershel... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.