code stringlengths 2 1.05M | repo_name stringlengths 5 101 | path stringlengths 4 991 | language stringclasses 3
values | license stringclasses 5
values | size int64 2 1.05M |
|---|---|---|---|---|---|
<#
.DESCRIPTION
Creates a new IP Range Firewall Rule if it does not already exist
.NOTES
Created by Mark Vaillancourt, Microsoft, 2016-08-03
.PARAMETER
$resourceGroupName
Name of the Resrouce Group to which the Server belongs
$subscriptionID
The Subscription ID of the Azure Subscr... | markvsql/ALittleHelpWithBigDataPublic | ALittleHelpWithBigData/Runbooks/Child/ChildNewAzureSQLDBServerFirewallRuleForIPRange.ps1 | PowerShell | mit | 3,048 |
#Get-TfsConfigServer "http://divcd83:8080/tfs" | Get-TfsTeamProjectCollectionAnalysis -Folder "C:\temp\Test_Analysis" -Verbose 4> "C:\Temp\Analysis_log.txt"
Write-Host "Loading DscTfs Module"
# Get TFS Object Model
$vsCommon = "Microsoft.VisualStudio.Services.Common"
$commonName = "Microsoft.TeamFoundation.Common"
$c... | agileramblings/powershell | DscTfs.psm1 | PowerShell | mit | 98,760 |
# Some enums
enum AccessRight {
Allow
Deny
}
enum ConnectionStatus {
Connected
Disconnected
}
enum TriggerType {
Command
Event
Regex
}
enum Severity {
Success
Warning
Error
None
}
enum LogLevel {
Info = 1
Verbose = 2
Debug = 4
}
enum LogSeverity {
Normal... | poshbotio/PoshBot | PoshBot/Classes/Enums.ps1 | PowerShell | mit | 1,096 |
function New-Column
{
<#
.SYNOPSIS
Creates a column object of an explicit datatype which can be used with the `Add-Table` or `Update-Table` migrations.
.DESCRIPTION
Use this function in the `Column` script block for `Add-Table`:
Add-Table 'Members' {
New-Column 'Birth... | RivetDB/Rivet | Rivet/Functions/Columns/New-Column.ps1 | PowerShell | apache-2.0 | 7,662 |
function Get-Product
{
Get-WmiObject -Class Win32_Product
}
function Uninstall-Product
{
[CmdletBinding()]
param([Parameter(ValueFromPipeline=$true)]$Product)
process{
if($Product -is [System.Management.ManagementBaseObject]){
$wmiobj = [System.Management.ManagementBaseObject]$Prod... | xunilrj/sandbox | sources/Powershell/Modules/Windows/Windows.psm1 | PowerShell | apache-2.0 | 1,348 |
<#
.DESCRIPTION
Stops the httd server, removing the container and associated volumes.
#>
docker rm --force --volumes build-static | LukeTillman/dse-docker | srv/stop-server.ps1 | PowerShell | apache-2.0 | 138 |
$packageName = 'ipnetinfo.portable'
$url = 'http://www.nirsoft.net/utils/ipnetinfo.zip'
$checksum = '39aac1532c9a63c225d827f94b1cd30f0d1c1c6b'
$checksumType = 'sha1'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsDir "ipnetinfo.exe"
Install-ChocolateyZipPackage -P... | dtgm/chocolatey-packages | automatic/_output/ipnetinfo.portable/1.71/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 627 |
$thisDir = (Split-Path $MyInvocation.MyCommand.Path)
Set-Alias nuget "$thisDir/.nuget/Nuget.exe"
nuget update -Self
nuget pack T4TS.nuspec -Prop Configuration=Release -IncludeReferencedProjects | lionsoft/t4ts | Nuget-Pack.ps1 | PowerShell | apache-2.0 | 193 |
$packageName = 'multipar.portable'
$url = 'http://multipar.eu//download/MultiPar1298.zip'
$checksum = '9513D6EC1CFAC25370446A45A76AD10C66EEF0A8'
$checksumType = 'sha1'
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsDir "MultiPar.exe"
Install-ChocolateyZipPackage ... | dtgm/chocolatey-packages | automatic/_output/multipar.portable/1.2.9.8/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 631 |
function Get-VSS3BucketLocation {
<#
.SYNOPSIS
Gets the location of a specific S3 bucket
.PARAMETER BucketName
The name of the bucket you are trying to locate.
.PARAMETER ProfileName
The name of the configuration profile to deploy the stack with. Defaults to $env:AWS_PROFILE, if set.
... | scrthq/Vaporshell | VaporShell/Public/SDK Wrappers/S3/Get-VSS3BucketLocation.ps1 | PowerShell | apache-2.0 | 1,219 |
function New-VSSNSTopic {
<#
.SYNOPSIS
Adds an AWS::SNS::Topic resource to the template. The AWS::SNS::Topic resource creates a topic to which notifications can be published.
.DESCRIPTION
Adds an AWS::SNS::Topic resource to the template. The AWS::SNS::Topic resource creates a topic to which... | scrthq/Vaporshell | VaporShell/Public/Resource Types/New-VSSNSTopic.ps1 | PowerShell | apache-2.0 | 15,998 |
[System.Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '')]
param ()
$here = Split-Path -Parent $MyInvocation.MyCommand.Path;
$sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace('.Tests.ps1', '')
$moduleRoot = Split-Path -Path (Split-Path -Path $here -Parent... | VirtualEngine/XenDesktop7 | Tests/Unit/VE_XD7DesktopGroup.Tests.ps1 | PowerShell | mit | 12,158 |
$CommandName = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandPath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"
Describe "$CommandName Unit Tests" -Tag 'UnitTests' {
BeforeAll {
$server = Connect-DbaInstance -SqlInstance $script:instance2
$ran... | SirCaptainMitch/dbatools | tests/Write-DbaDataTable.Tests.ps1 | PowerShell | mit | 988 |
$packageName = 'multipar.install'
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$url = 'http://multipar.eu//download/archive/dl.php?fn=MultiPar127_setup.exe'
$checksum = 'E597A60027CF759E2EC37D6771E68F337400C1F5'
$checksumType = 'sha1'
$validExitCodes = @(0)
Install-ChocolateyPa... | dtgm/chocolatey-packages | automatic/_output/multipar.install/1.2.7.6/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 672 |
# Copyright 2017 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | GoogleCloudPlatform/compute-image-windows | auto_updater/auto_updater.ps1 | PowerShell | apache-2.0 | 2,038 |
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org... | atpham256/azure-powershell | src/ResourceManager/CognitiveServices/CognitiveServices.Test/ScenarioTests/CognitiveServicesAccountTests.ps1 | PowerShell | apache-2.0 | 16,474 |
$CommandName = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandPath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"
Describe "$CommandName Unit Tests" -Tag 'UnitTests' {
Context "Validate parameters" {
[object[]]$params = (Get-Command $CommandName).Parame... | Splaxi/dbatools | tests/Test-DbaCmConnection.Tests.ps1 | PowerShell | mit | 1,026 |
# Copyright (c) 2010 RightScale Inc
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modify, merge, publish,
# di... | rightscale/cookbooks_public_windows | cookbooks/db_sqlserver/powershell_providers/database/restore.ps1 | PowerShell | mit | 5,646 |
[CmdletBinding()]
param()
. $PSScriptRoot\..\..\..\Tests\lib\Initialize-Test.ps1
. $PSScriptRoot\MockVariable.ps1 -Force
. $PSScriptRoot\MockHelper.ps1 -Force
Unregister-Mock Get-VstsInput
Unregister-Mock Start-Job
Unregister-Mock Receive-Job
Unregister-Mock Get-Job
Unregister-Mock Remove-Job
Unregister-Mock Start-S... | dylan-smith/vso-agent-tasks | Tasks/WindowsMachineFileCopyV2/Tests/L0ParallelCopyFail.ps1 | PowerShell | mit | 2,240 |
function test-globalbower {
$result = $true
try {
$(& bower --version) | Out-Null
}
catch {
$result = $false
}
return $result
}
function bower-install {
param(
[String]
[parameter(Mandatory=$true)]
$sourceDirectory
)
exec {
#... | tugberkugurlu/KLoggy | scripts/Core/bower.ps1 | PowerShell | mit | 511 |
Get-Module -Name Barracuda.WAF | Remove-Module -Force
Import-Module $(Join-Path -Path $PSScriptRoot -ChildPath '../Barracuda.WAF/Barracuda.WAF.psd1') -Force
InModuleScope Barracuda.WAF {
Describe "Update-BarracudaWAFServer" {
It "should support update server using ip address" {
Mock Invoke-Ap... | juniinacio/Barracuda.WAF | tests/Update-BarracudaWAFServer.Tests.ps1 | PowerShell | mit | 2,637 |
Start-AutoRestCodeGeneration -ResourceProvider "quota/resource-manager" -AutoRestVersion "v2" | Azure/azure-sdk-for-net | sdk/quota/Microsoft.Azure.Management.Quota/src/generate.ps1 | PowerShell | mit | 93 |
#
# Backup.ps1
#
# Backup all non-system databases to the default backup directory using the database name as filename.
# TODO: Create a function and allow using -Force to also backup system databases
Exit
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.Smo")
[System.Reflection.Assembly]::LoadWi... | eidias/Gallery | PowerShell/SqlServer/Backup.ps1 | PowerShell | mit | 1,466 |
@{
AllNodes =
@(
@{
NodeName="*"
TemplateVHDX="m:\template\win2016.vhdx"
},
@{
NodeName="lab-xxxxx"
Role="HyperV"
path="m:\vm\"
VMs=@(... | omiossec/PowerShellSaterday-OM | 2-createVMs/CreateVMsDSC/simpledata.psd1 | PowerShell | mit | 1,503 |
$ModulePath = Split-Path $MyInvocation.MyCommand.Path
$ScriptList = Get-ChildItem -Path "$ModulePath\Scripts" -Filter '*.ps1'|
Where-Object -Property FullName -NotMatch '\.tests\.ps1$'
foreach ($Script in $ScriptList)
{
Try
{
$ScriptPath = $Script.FullName
. $ScriptPath
}
Catch
... | fullenw1/OrphanForeignSecurityPrincipals | OrphanForeignSecurityPrincipals.psm1 | PowerShell | mit | 403 |
$Computer='notonline'
Try{
$os=Get-Wmiobject -ComputerName $Computer -Class Win32_OperatingSystem `
-ErrorAction Stop -ErrorVariable CurrentError
}
Catch{
Write-warning "You done made a boo-boo with computer $Computer"
} | EmpressDeIT/PowerShell | PST_Scripts/Mod7/3SimpleTryCatch.ps1 | PowerShell | mit | 262 |
<#
Installs the specified PowerShell module using PowerShellGallery.
#>
[CmdletBinding()]
param(
[ValidateNotNullOrEmpty()]
[string] $moduleName
)
##################################################################################################
#
# Powershell Configurations
#
# Note: Because the $ErrorActi... | Azure/azure-devtestlab | Artifacts/windows-install-powershell-module/Install-PowerShellModule.ps1 | PowerShell | mit | 2,791 |
$zoneName = "A.test"
$zoneScope = 'external'
$ConfigurationData = @{
AllNodes = , @{
NodeName = 'localhost'
CertificateFile = $Null
}
NonNodeData = @{
DnsRecordAScoped_CreateRecord_Config = @{
ZoneName = $zoneName
ZoneScope = $zoneScope
... | PowerShell/xDnsServer | tests/Integration/Classes/DnsRecordAScoped.config.ps1 | PowerShell | mit | 4,067 |
#region Info
<#
#################################################
# modified by : Joerg Hochwald
# last modified : 2016-04-13
#################################################
Support: https://github.com/jhochwald/NETX/issues
#>
#endregion Info
#region License
<#
Copyright (c) 2012-2016, NET-Experts <h... | jhochwald/MyPowerShellStuff | Profile/functions/ConvertTo-HashTable.ps1 | PowerShell | mit | 15,189 |
# Install Bazel pre-reqs on Windows
# https://docs.bazel.build/versions/master/install-windows.html
# https://docs.bazel.build/versions/master/windows.html
# Install MSYS2 and packages
choco install msys2 --version 20200903.0.0 --no-progress --package-parameters "/NoUpdate"
C:\tools\msys64\usr\bin\bash.exe -l -c "pacma... | brandonroberts/angular | .circleci/windows-env.ps1 | PowerShell | mit | 3,915 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
<#
.SYNOPSIS
Starts the language and debug services from the PowerShellEditorServices module.
.DESCRIPTION
PowerShell Editor Services Bootstrapper Script
----------------------------------------------
This script contains startup ... | PowerShell/PowerShellEditorServices | module/PowerShellEditorServices/Start-EditorServices.ps1 | PowerShell | mit | 3,062 |
[CmdletBinding(DefaultParameterSetName='default')]
param
(
[Parameter(Mandatory=$true,Position=0,ParameterSetName='Explicit')]
[uri]
$Uri,
[Parameter(Mandatory=$true,Position=1,ParameterSetName='Explicit')]
[version]
$Version
)
Set-StrictMode -Version Latest
[Net.ServicePointManag... | jcasale/vim-msi | build.ps1 | PowerShell | mit | 4,294 |
function Get-DynmicParam {
<#
.SYNOPSIS
Gets the dynamic parameter for the main functions
.DESCRIPTION
Dynamically sets the correct tab completeable validate set for the coreobject, coretaskobject, coreactivetaskobject, or string to search
.PARAMETER paramName
the name of the parameter being dynamically set within th... | FOGProject/fog-community-scripts | PowershellModules/FogApi/FogApi/Private/Get-DynmicParam.ps1 | PowerShell | mit | 2,784 |
$port=8000
# Create server
$endpoint = New-Object System.Net.IPEndPoint([System.Net.IpAddress]::Any, $port)
$listener = New-Object System.Net.Sockets.TcpListener($endpoint)
$listener.Start()
Write-Host 'Listening on port'$port'...'
# Wait for connection
$client = $listener.AcceptTcpClient()
$stream = $client.GetStre... | sweetsoftware/ReversePowershell | server.ps1 | PowerShell | mit | 825 |
function Set-Telemetry {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[ValidateSet("Enable","Disable")]
[string] $Action)
$Paths = @("HKLM:\SOFTWARE\Policies\Microsoft\Windows\DataCollection","HKLM:\SOFTWARE\Wow6432Node\Policies\Microsoft\Windows\DataCollection")
switc... | nathan-alden/windows-10-tracking | Source/Scripts/Set-Telemetry.ps1 | PowerShell | apache-2.0 | 838 |
function New-CharColumn
{
<#
.SYNOPSIS
Creates a column object representing an Char datatype.
.DESCRIPTION
Use this function in the `Column` script block for `Add-Table`:
Add-Table -State 'Addresses' -Column {
Char 'State' 2
}
## ALIASES
* Char... | RivetDB/Rivet | Rivet/Functions/Columns/New-CharColumn.ps1 | PowerShell | apache-2.0 | 2,311 |
# ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org... | CamSoper/azure-powershell | src/ResourceManager/Compute/Commands.Compute.Test/ScenarioTests/VirtualMachineTests.ps1 | PowerShell | apache-2.0 | 121,559 |
# Sample script to install Miniconda under Windows
# Authors: Olivier Grisel, Jonathan Helmus and Kyle Kastner, Robert McGibbon
# License: CC0 1.0 Universal: http://creativecommons.org/publicdomain/zero/1.0/
$MINICONDA_URL = "http://repo.continuum.io/miniconda/"
function DownloadMiniconda ($python_version, $platform... | m-labs/llvmlite | conda-recipes/appveyor/install.ps1 | PowerShell | bsd-2-clause | 3,114 |
BuildTask UpdateAppVeyorVersion -Stage Setup -Order 3 -If {
Test-Path (Join-Path $buildInfo.Path.ProjectRoot 'appveyor.yml')
} -Definition {
$versionString = '{0}.{1}.{2}.{{build}}' -f @(
$buildInfo.Version.Major
$buildInfo.Version.Minor
$buildInfo.Version.Build
)
$path = Join-... | indented-automation/BuildTools | Indented.Build/task/Setup/UpdateAppVeyorVersion.ps1 | PowerShell | mit | 541 |
Function Get-UnitylunDelete {
<#
.SYNOPSIS
Parameters used for deleting a LUN when modifying a Consistency group. <br/> <br/> This resource type is embedded in the storageResource resource type.
.DESCRIPTION
Parameters used for deleting a LUN when modifying a Consistency group. <br/> <br/> ... | equelin/Unity-Powershell | Tools/Functions/Result_UnityVSA_41/Get-UnitylunDelete.ps1 | PowerShell | mit | 1,976 |
<#
.EXAMPLE
This example shows how to use the local farm token to grant
full control permission to the local farm to the
user profile service app's sharing permission.
#>
Configuration Example
{
param(
[Parameter(Mandatory = $true)]
[PSCredential]
$SetupA... | ykuijs/xSharePoint | Modules/SharePointDsc/Examples/Resources/SPServiceAppSecurity/2-Example.ps1 | PowerShell | mit | 1,007 |
$script:ErrorActionPreference = "Stop"
$password = .\Get-ConfigurationPropertyValue.ps1 Password
$securePassword = ConvertTo-SecureString $password -AsPlainText -Force
$domain = .\Get-ConfigurationPropertyValue.ps1 Domain
$userName = .\Get-ConfigurationPropertyValue.ps1 UserName
$credential = new-object Manageme... | XinwLi/Interop-TestSuites-1 | SharePoint/Source/MS-SHDACCWS/Adapter/SUTControlAdapter/Implementation/SUTSetExclusiveLock.ps1 | PowerShell | mit | 1,836 |
# Do loop
$i= 1
Do {
Write-Output "PowerShell is Great! $i"
$i=$i+1 # $i++
} While ($i -le 5) #Also Do-Until
# While Loop
$i=5
While ($i -ge 1) {
Write-Output "Scripting is great! $i"
$i--
}
| kidchenko/playground | powershell-advanced-tools-and-scripting-with-powershell/Mod2/7Do_While.ps1 | PowerShell | mit | 212 |
function Get-DbaDbIdentity {
<#
.SYNOPSIS
Checks the current identity value via DBCC CHECKIDENT with NORESEED optuin
.DESCRIPTION
Use the command DBCC CHECKIDENT with NORESEED option to checks the current identity value of a table and return results
Read more:
- https:/... | wsmelton/dbatools | functions/Get-DbaDbIdentity.ps1 | PowerShell | mit | 6,880 |
$packageName = 'dolphin'
$url = 'http://dl.dolphin-emu.org/builds/dolphin-master-4.0-8233-x64.7z'
$checksum = '8eace3fc7b67d8e3c828bbe3cb831254583d556c'
$checksumType = 'sha1'
$url64 = $url
$checksum64 = $checksum
$checksumType64 = $checksumType
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
In... | dtgm/chocolatey-packages | automatic/_output/dolphin/4.0.8233/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 761 |
try {Import-Module $PSScriptRoot\..\..\ImportExcel.psd1} catch {throw ; return}
#Get rid of pre-exisiting sheet
$xlSourcefile = "$env:TEMP\ImportExcelExample.xlsx"
Write-Verbose -Verbose -Message "Save location: $xlSourcefile"
Remove-Item $xlSourcefile -ErrorAction Ignore
$leftCsv = @"
MyProp1,MyProp2,Length
a,b,10
... | dfinke/ImportExcel | Examples/MergeWorkSheet/MergeCSV.ps1 | PowerShell | apache-2.0 | 536 |
<#
Get-NetstatDistinctLocal16.ps1
Requires logparser.exe in path
Pulls distinct /16 local network addresses. Useful for building the
filter for local addresses in other analysis scripts, so you can see
what hosts are communicating to hosts outside your environment.
This script exepcts files matching the pattern
*ne... | vimokumar/Kansa | Analysis/Net/Get-NetstatDistinctLocal16IPv4.ps1 | PowerShell | apache-2.0 | 850 |
$commandname = $MyInvocation.MyCommand.Name.Replace(".Tests.ps1", "")
Write-Host -Object "Running $PSCommandpath" -ForegroundColor Cyan
. "$PSScriptRoot\constants.ps1"
Describe "$CommandName Unit Tests" -Tags "UnitTests" {
Context "Validate parameters" {
[object[]]$params = (Get-Command $CommandName).Param... | alevyinroc/dbatools | tests/Remove-DbaDbMirrorMonitor.Tests.ps1 | PowerShell | mit | 1,545 |
########################################################################
#
# Linux on Hyper-V and Azure Test Code, ver. 1.0.0
# Copyright (c) Microsoft Corporation
#
# All rights reserved.
# Licensed under the Apache License, Version 2.0 (the ""License"");
# you may not use this file except in compliance with the Licen... | ilenghel/lis-test | WS2012R2/lisa/setupscripts/SR-IOV_Host_Disable.ps1 | PowerShell | apache-2.0 | 9,221 |
# This artifact captures all variables defined in the ..\variables folder.
# It "snaps" the values of these variables where we can compute them during the build,
# and otherwise captures the scripts to run later during an Azure Pipelines environment release.
$RepoRoot = [System.IO.Path]::GetFullPath((Join-Path $PSScri... | AArnott/PCLCommandBase | azure-pipelines/artifacts/Variables.ps1 | PowerShell | mit | 1,929 |
<#
.SYNOPSIS
Automated unit test for DSC_SqlDatabasePermission DSC resource.
#>
Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath '..\TestHelpers\CommonTestHelper.psm1')
$script:dscModuleName = 'SqlServerDsc'
$script:dscResourceName = 'DSC_SqlDatabasePermission'
function Invoke-TestSetup
{
... | johlju/xSQLServer | tests/Unit/DSC_SqlDatabasePermission.Tests.ps1 | PowerShell | mit | 36,504 |
<#PSScriptInfo
.VERSION 1.0.0
.GUID 00a38891-00f6-4a17-9321-9b40ba4bd2b1
.AUTHOR DSC Community
.COMPANYNAME DSC Community
.COPYRIGHT DSC Community contributors. All rights reserved.
.TAGS DSCConfiguration
.LICENSEURI https://github.com/dsccommunity/xFailOverCluster/blob/main/LICENSE
.PROJECTURI https://github.c... | PowerShell/xFailOverCluster | source/Examples/Resources/xClusterNetwork/1-xClusterNetwork_ChangeClusterNetworkConfig.ps1 | PowerShell | mit | 1,508 |
$vcVer = "vc2015"
$applyPatch = $TRUE
# $useReleasePackage = $TRUE
.\build-vc-core.ps1
| cosmo0920/PowerShell-for-Mroonga-building | powershell/build-vc2015.ps1 | PowerShell | mit | 91 |
function Remove-DbaAgentSchedule {
<#
.SYNOPSIS
Remove-DbaAgentJobSchedule removes a job schedule.
.DESCRIPTION
Remove-DbaAgentJobSchedule removes a job in the SQL Server Agent.
.PARAMETER SqlInstance
The target SQL Server instance or instances. You must have sysadmin access an... | Splaxi/dbatools | functions/Remove-DbaAgentSchedule.ps1 | PowerShell | mit | 8,144 |
function Repair-DbaInstanceName {
<#
.SYNOPSIS
Renames @@SERVERNAME to match with the Windows name.
.DESCRIPTION
When a SQL Server's host OS is renamed, the SQL Server should be as well. This helps with Availability Groups and Kerberos.
This command renames @@SERVERNAME to match wi... | wsmelton/dbatools | functions/Repair-DbaInstanceName.ps1 | PowerShell | mit | 13,724 |
<#
.SYNOPSIS
This is a Powershell script to bootstrap a Cake build.
.DESCRIPTION
This Powershell script will download NuGet if missing, restore NuGet tools (including Cake)
and execute your Cake build script with the parameters you provide.
.PARAMETER Target
The build script target to run.
.PARAMETER Configuration
The ... | Marusyk/Simple.HttpPatch | build.ps1 | PowerShell | mit | 4,665 |
$script:SPDscUtilModulePath = Join-Path -Path $PSScriptRoot -ChildPath '..\..\Modules\SharePointDsc.Util'
Import-Module -Name $script:SPDscUtilModulePath
function Get-TargetResource
{
[CmdletBinding()]
[OutputType([System.Collections.Hashtable])]
param
(
[Parameter(Mandatory = $true)]
[... | PowerShell/xSharePoint | SharePointDsc/DSCResources/MSFT_SPProjectServerServiceApp/MSFT_SPProjectServerServiceApp.psm1 | PowerShell | mit | 8,030 |
#Requires -RunAsAdministrator
# Update default Administrator
$Admin_Password = Read-Host -Prompt "Passsword for user Administrator" -AsSecureString
$Admin_Account = Get-LocalUser -Name "Administrator"
$Admin_Account | Set-LocalUser -Password $Admin_Password
# Adapt local groups
Add-LocalGroupMember -Group "Administra... | christianjaeckle/Powershell-Scripts | Configure Workstation - Win10/Users & Groups.ps1 | PowerShell | mit | 738 |
function Test-RunningAsAdministrator
{
<#
.SYNOPSIS
Determines whether the script is running with Administrator privileges
.INPUTS
None
.OUTPUTS
System.Boolean Returns a boolean value indicating whether the script is
running with Administrator privileges.
... | dkbriley/powershell-utils | Test-RunningAsAdministrator.ps1 | PowerShell | mit | 609 |
function ConvertTo-In
{
<#
.SYNOPSIS
Convert millimeters into inches
#>
[CmdletBinding()]
[OutputType([System.Single])]
param
(
[Parameter(Mandatory, ValueFromPipeline)]
[Alias('mm','Millimetre')]
[System.Single] $Millimeter
)
process
{
$in = $Mill... | iainbrighton/PScribo | Src/Private/ConvertTo-In.ps1 | PowerShell | mit | 386 |
Remove-Module -Name 'Rubrik' -ErrorAction 'SilentlyContinue'
Import-Module -Name './Rubrik/Rubrik.psd1' -Force
foreach ( $privateFunctionFilePath in ( Get-ChildItem -Path './Rubrik/Private' | Where-Object extension -eq '.ps1').FullName ) {
. $privateFunctionFilePath
}
Describe -Name 'Public/New-RubrikHyperVVMMou... | rubrikinc/PowerShell-Module | Tests/New-RubrikHyperVVMMount.Tests.ps1 | PowerShell | mit | 4,637 |
#requires -Version 3
function Get-RubrikVM
{
<#
.SYNOPSIS
Retrieves details on one or more virtual machines known to a Rubrik cluster
.DESCRIPTION
The Get-RubrikVM cmdlet is used to pull a detailed data set from a Rubrik cluster on any number of virtual machines
.NOTES
Written by... | rubrikinc/PowerShell-Module | Rubrik/Public/Get-RubrikVM.ps1 | PowerShell | mit | 5,829 |
function Get-File($InitialDirectory, [switch]$AllowMultiSelect){
Add-Type -AssemblyName System.Windows.Forms
$openFileDialog = New-Object System.Windows.Forms.OpenFileDialog
$openFileDialog.InitialDirectory = $InitialDirectory
$openFileDialog.ShowHelp = $true
$openFileDialog.Filter = "All files (... | DBremen/Show-CommandGUI | Private/Get-File.ps1 | PowerShell | mit | 662 |
function Get-SlackUser {
<#
.SYNOPSIS
Get info on a Slack user
.DESCRIPTION
Get info on a Slack user
.PARAMETER Token
Token to use for the Slack API
Default value is the value set by Set-PSSlackConfig
.PARAMETER Presence
Whether to include presence inform... | RamblingCookieMonster/PSSlack | PSSlack/Public/Get-SlackUser.ps1 | PowerShell | mit | 3,431 |
$packageName = 'dumo'
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$url = 'http://www.kcsoftwares.com/files/dumo_lite.exe'
$checksum = '9f831005ef55ad1c06d44c04010b9e27a34494723d02b8be95717bb2840db814'
$checksumType = 'sha256'
$validExitCodes = @(0)
Install-ChocolateyPackage -P... | dtgm/chocolatey-packages | automatic/_output/dumo/2.8.1.50/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 664 |
Import-Module poshspec -Verbose:$false -ErrorAction Stop
describe 'More services' {
context 'Important Services' {
service winrm status { should be running }
service schedule status { should be running }
}
}
| devblackops/watchmen | TestArtifacts/OVFModules/OVF.Example2/Diagnostics/Comprehensive/more.services.tests.ps1 | PowerShell | apache-2.0 | 235 |
Function Get-ICAOCode {
param (
$iata
)
# status Y means current data
$Fields = @{"status" = "Y"; "iataairl" = "$iata"}
$avcode = Invoke-RestMethod -Uri "http://avcodes.co.uk/airlcoderes.asp" -Method Post -Body $Fields -Verbose
$regex = 'ICAO Code:<br /> \D{3}'
$avcode -match $regex | Out-Null
... | davidobrien1985/metarSlackbot | flightStatus/modules/PSFlightAware.psm1 | PowerShell | apache-2.0 | 3,364 |
function Test-Component($Name, $Package)
{
if([System.String]::IsNullOrEmpty($Package)){
$Package = $Name
}
Write-Verbose "Searching $Package"
$result = command $Name
if($result -eq $null){
Write-Verbose "$Package not founded. Installing..."
if($Name.ToLower() -eq "choco"){... | xunilrj/sandbox | sources/scripts/EnvironmentNode.psm1 | PowerShell | apache-2.0 | 5,546 |
<#
.DESCRIPTION
This example will set the TCP/IP address group IPAll to use static ports.
The resource will be run as the account provided in $SystemAdministratorAccount.
#>
Configuration Example
{
param
(
[Parameter(Mandatory = $true)]
[System.Management.Automation.PSCreden... | johlju/xSQLServer | source/Examples/Resources/SqlProtocolTcpIp/3-ConfigureIPAddressGroupIP1.ps1 | PowerShell | mit | 1,142 |
[CmdletBinding()]
param()
# Arrange.
. $PSScriptRoot\..\..\..\..\Tests\lib\Initialize-Test.ps1
Unregister-Mock Import-Module
Register-Mock Write-VstsTaskError
Register-Mock Get-VstsWebProxy { }
$module = Microsoft.PowerShell.Core\Import-Module $PSScriptRoot\.. -PassThru
& $module { $script:azureModule = @{ Version = [... | maikvandergaag/msft-vsts-extensions | azuredevops/azureresourcegroup/azureresourcegroup/ps_modules/VstsAzureHelpers_/Tests/Initialize-AzureSubscription.PassesValuesWhenCertAuthAndEnvironment.ps1 | PowerShell | mit | 2,746 |
# Copyright (c) Microsoft Corporation.
# Licensed under the MIT License.
Describe 'enums' -Tags "CI" {
Context 'basic enums' {
enum E1
{
e0
e1
e2
}
It "has correct value 0" { [E1]::e0 | Should -Be ([E1]0) }
It "has correct value 1" { [E1]... | TravisEz13/PowerShell | test/powershell/Language/Classes/scripting.enums.tests.ps1 | PowerShell | mit | 5,416 |
<#
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See License.txt in the project root for license information.
#>
<#
.SYNOPSIS
Description of a bare metal node used for ScaleOut operation on a cluster.
.DESCRIPTION
Description of a bare metal node used for ScaleOut o... | AzureAutomationTeam/azure-powershell | src/StackAdmin/Azs.Fabric.Admin/Module/Azs.Fabric.Admin/Generated.PowerShell.Commands/SwaggerDefinitionCommands/New-BareMetalNodeDescriptionObject.ps1 | PowerShell | apache-2.0 | 2,007 |
function Get-AzureRmStorageAccount
{
[CmdletBinding()]
param(
[string] [Parameter(Position=0, ValueFromPipelineByPropertyName=$true)] $ResourceGroupName,
[string] [Parameter(Position=1, ValueFromPipelineByPropertyName=$true)] [alias("StorageAccountName")] $Name)
BEGIN {
$context = Get-Context
... | zhencui/azure-powershell | src/ResourceManager/Common/Commands.ScenarioTests.ResourceManager.Common/AzureRM.Storage.ps1 | PowerShell | apache-2.0 | 7,975 |
#
# Module manifest for module 'Microsoft.WindowsAzure.Commands.StorSimple'
#
# Generated by: Microsoft Corporation
#
# Generated on: 1/18/2015
#
@{
# Version number of this module.
ModuleVersion = '0.8.13'
# ID used to uniquely identify this module
GUID = 'd52ed268-64c7-46bd-9cf8-1814d07409f8'
# Author of this mod... | kagamsft/azure-powershell | src/ServiceManagement/StorSimple/Commands.StorSimple/Microsoft.WindowsAzure.Commands.StorSimple.dll-help.psd1 | PowerShell | apache-2.0 | 2,370 |
# copies System.Management.Automation.dll from the GAC to this folder
cp ([PSObject].Assembly.Location) . | magicmonty/Paket | src/Paket.PowerShell/System.Management.Automation.ps1 | PowerShell | mit | 105 |
#Fabio's local Group Membership Toolkit
#Released under the terms of the MIT X-license.
#SETTINGS
$computerName = "atvies99000srv.ww300.siemens.net" #Name des Computers/servers auf dem die lokale Gruppe gespeichert wird (für Lokal "$env:computername" eintragen)
$Delimiter = "\" #benützt um CSV zu lesen
$Hea... | Sirius-A/powershell-stuff | GroupManager/GroupManager.ps1 | PowerShell | mit | 6,504 |
# .ExternalHelp psPAS-help.xml
Function Set-PASPTAEvent {
[CmdletBinding(SupportsShouldProcess)]
param(
[parameter(
Mandatory = $true,
ValueFromPipelinebyPropertyName = $true
)]
[string]$EventID,
[parameter(
Mandatory = $false,
ValueFromPipelinebyPropertyName = $true
)]
[ValidateSet("OPEN", "... | pspete/psPAS | psPAS/Functions/EventSecurity/Set-PASPTAEvent.ps1 | PowerShell | mit | 973 |
function Measure-DbaDbVirtualLogFile {
<#
.SYNOPSIS
Returns calculations on the database virtual log files for database on a SQL instance.
.DESCRIPTION
Having a transaction log file with too many virtual log files (VLFs) can hurt database performance.
Too many VLFs can cause transa... | wsmelton/dbatools | functions/Measure-DbaDbVirtualLogFile.ps1 | PowerShell | mit | 5,786 |
#example 1:
Get-MailboxDatabase -Status | select-object Name,DatabaseSize
#example 2:
Get-MailboxDatabase -Status |
select-object Name,Server,DatabaseSize,Mounted |
Export-CSV Path c:\databasereport.csv -NoTypeInformation
#example 3:
Get-MailboxDatabase -Status |
Select-Object Name,
@{n="Databas... | mikepfeiffer/ex-2013-ps-cookbook | Chapter 6/ReportingonMailboxDatabaseSize.ps1 | PowerShell | mit | 355 |
rm *.nupkg
nuget pack .\SpriteAnimationBuddy.nuspec -IncludeReferencedProjects -Prop Configuration=Release
cp *.nupkg C:\Projects\Nugets\
nuget push -source https://www.nuget.org -NonInteractive *.nupkg | dmanning23/SpriteAnimationBuddy | SpriteAnimationBuddy/buildNugetPackages.ps1 | PowerShell | mit | 202 |
[cmdletbinding()]
Param()
Import-Module $PSScriptRoot\..\Az.DevTestLabs2.psm1 -Verbose:$false
$lab = @(
[pscustomobject]@{Name=('DtlLibrary-VmExtended-' + (Get-Random)); ResourceGroupName=('DtlLibrary-VmExtendedRg-' + (Get-Random)); Location='eastus'}
)
$vm = @(
[pscustomobject]@{VmName=('Vm-' + (Get-Random)... | Azure/azure-devtestlab | samples/DevTestLabs/Modules/Library/Tests/Vm-ExtendedStatus.tests.ps1 | PowerShell | mit | 2,398 |
[CmdletBinding()]
param()
. $PSScriptRoot\..\..\lib\Initialize-Test.ps1
# Arrange
$distributedTaskContext = 'Some distributed task context'
function VerifyPrRun
{
param([string]$SQPullRequestBotSetting, [bool]$IsPrBuild, [bool]$ExpectedToRun )
# Arrange
if ($SQPullRequestBotSetting -ne $null)
{
... | cwoolum/vso-agent-tasks | Tests/L0/SonarQubePreBuild/DisableAnalysisOnPrBuild.ps1 | PowerShell | mit | 1,942 |
function Get-DbaDbExtentDiff {
<#
.SYNOPSIS
What percentage of a database has changed since the last full backup
.DESCRIPTION
This is only an implementation of the script created by Paul S. Randal to find what percentage of a database has changed since the last full backup.
... | SirCaptainMitch/dbatools | functions/Get-DbaDbExtentDiff.ps1 | PowerShell | mit | 7,430 |
<#---------------------------------
Auto-publish changes to master branch as a new module version in the PSGallery.
- Only publish if build version is greater than 1.0
- Skip Auto-publish with specific commit message of "Manual Deployment"
---------------------------------#>
if (-not ($ENV:APPVEYOR_PULL_REQUEST_NUMBE... | pspete/psPAS | build/deploy-psgallery.ps1 | PowerShell | mit | 1,996 |
Enum EntityType
{
Name
Value
TypeName
}
Function Entity
{
<#
.SYNOPSIS
Convert an object into a PSGraph Record
.DESCRIPTION
Convert an object into a PSGraph Record
.PARAMETER InputObject
The object to convert into a record
.PARAMETER Name
The name of the node
.P... | KevinMarquette/PSGraph | PSGraph/Public/Entity.ps1 | PowerShell | mit | 2,942 |
#Requires -RunAsAdministrator
Push-Location HKCU:\Software\Microsoft\Windows\CurrentVersion\
sp Explorer ShowRecent 0 # Do not show recently used files in Quick access
sp Explorer ShowFrequent 0 # Do not show frequently used folders in Quick access
sp Explorer\Advanced Hidden 1 # Show hidden files, folders, or drives... | matt9ucci/PSProfiles | PSScripts/Initialize-Windows.ps1 | PowerShell | mit | 966 |
[cmdletbinding()]
param ()
function CheckAccountOnComputers() {
$Computers = Import-CSV -Path "c:\scripts\adminservers.csv"
$cred = Get-Credential
foreach ($Computer in $Computers) {
$Computername = $Computer.Name.toupper()
$Isonline = "OFFLINE"
$PasswordValidationStatus = "FAILED"
Wri... | abix-/powershell-practical | random scripts/windows-server/Check-LocalAdmin.ps1 | PowerShell | mit | 1,217 |
Import-Module -Name (Join-Path -Path (Split-Path (Split-Path $PSScriptRoot -Parent) -Parent) `
-ChildPath 'SqlServerDscHelper.psm1') `
-Force
<#
.SYNOPSIS
Returns the current permissions for the user in the database
.PARAMETER Database
This is the SQL database
.PARAMETER Name
This ... | jpogran/puppetlabs-dsc | lib/puppet_x/dsc_resources/SqlServerDsc/DSCResources/MSFT_SqlDatabasePermission/MSFT_SqlDatabasePermission.psm1 | PowerShell | apache-2.0 | 13,811 |
function Remove-UniqueKey
{
<#
.SYNOPSIS
Removes the Unique Constraint from the database
.DESCRIPTION
Removes the Unique Constraint from the database.
.EXAMPLE
Remove-UniqueKey 'Cars' -Name 'YearUK'
Demonstrates how to remove a unique key whose name is different than the... | RivetDB/Rivet | Rivet/Functions/Operations/Remove-UniqueKey.ps1 | PowerShell | apache-2.0 | 1,208 |
[CmdletBinding()]
param (
[Parameter(Position = 0, Mandatory = $false, ParameterSetName = "Path", ValueFromPipeline = $true)]
[ValidateScript( { (Test-Path -Path $_) })]
[String]$Path = (get-location).Path,
[switch]$Recurse,
[switch]$WriteSummary
)
Import-Module ${env:HOME}\dev\powershell\Modules\Get-Directo... | mattia72/powershell | Optimize-GitRepo.ps1 | PowerShell | apache-2.0 | 2,415 |
#
# Module manifest for module 'PSGet_AzureRM.SiteRecovery'
#
# Generated by: Microsoft Corporation
#
# Generated on: 6/4/2017
#
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '4.1.0'
# Supported PSEditions
# CompatiblePSEdi... | atpham256/azure-powershell | src/ResourceManager/SiteRecovery/AzureRM.SiteRecovery.psd1 | PowerShell | apache-2.0 | 7,703 |
./generatesolutions.ps1 -Build
if($LASTEXITCODE -eq 0 ) {
#OpenCppCoverage --sources ./sources -- ./.build/msvc64/Debug/eulerproblems.exe
Write-Information "Running..."
./.build/msvc64/Debug/cppdynamic.exe
}
| xunilrj/sandbox | sources/cpp/cpp-dynamicprogramming/runtests.ps1 | PowerShell | apache-2.0 | 222 |
properties {
$BaseDir = Resolve-Path "."
$OutputPath = "$BaseDir\output"
$SolutionPath = "$BaseDir\src\Nerve.EventStore.sln"
$NugetPath = "$BaseDir\src\.nuget\nuget.exe"
$BuiltPath = "$OutputPath\built"
$OpenCoverVersion = "4.5.2506"
$MSpecVersion = "0.8.2"
$Configuration = "Rele... | Kostassoid/Nerve.EventStore | build.ps1 | PowerShell | apache-2.0 | 1,873 |
<#
.SYNOPSIS
Configures PowerShell so that Carbon's DSC resources can use Carbon functions/commands.
#>
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/lic... | pshdo/Carbon | Carbon/DscResources/Initialize-CarbonDscResource.ps1 | PowerShell | apache-2.0 | 1,002 |
#
# Module manifest for module 'Microsoft.Azure.Commands.Dns'
#
# Generated by: Microsoft Corporation
#
# Generated on: 9/19/2015
#
@{
# Version number of this module.
ModuleVersion = '1.0.5'
# ID used to uniquely identify this module
GUID = '5e5ed8bc-27bf-4380-9de1-4b22ba0920b2'
# Aut... | haocs/azure-powershell | src/ResourceManager/Dns/AzureRM.Dns.psd1 | PowerShell | apache-2.0 | 3,287 |
$packageName = 'ofview.install'
$installerType = 'exe'
$url = 'http://www.nirsoft.net/utils/ofview_setup.exe'
$checksum = 'c34ec5918137cca28cb2a975ef805221b1b7e958b3b3ad1ed1447730f7982157'
$checksumType = 'sha256'
$silentArgs = '/S'
$validExitCodes = @(0)
Install-ChocolateyPackage -PackageName "$packageName" `
... | dtgm/chocolatey-packages | automatic/_output/ofview.install/1.85/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 627 |
$packageName = 'firefox-nightly'
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$url = 'https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-59.0a1.en-US.win32.installer.exe'
$checksum = '697d0d140bd10b8df7b8686d66a92c0f36ec7a257f05703a90b1e0006fa90271'
$c... | dtgm/chocolatey-packages | automatic/_output/firefox-nightly/59.0.1.2017120400/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 1,131 |
<#
.SYNOPSIS
Create a new filter for when a Named Pipe is created or connected.
.DESCRIPTION
Create a new filter for when a Named Pipe is created or connected.
Useful for watching malware inter process communication.
#>
function New-SysmonPipeFilter {
[CmdletBinding(DefaultParameterSetName = 'Path',
HelpUri = '... | darkoperator/Posh-Sysmon | Functions/New-SysmonPipeFilter.ps1 | PowerShell | bsd-3-clause | 2,899 |
# Copyright (c) .NET Foundation and Contributors
# See LICENSE file in the project root for full license information.
# patterns to be replaced in the templates
$toolchainPattern = "<absolute-path-to-the-toolchain-folder-mind-the-forward-slashes>"
$esp32ToolchainPattern = "<absolute-path-to-the-esp32-toolchain-folder-... | nanoframework/nf-interpreter | install-scripts/configure-vscode-common.psm1 | PowerShell | mit | 14,043 |
########################################################################
#
# Linux on Hyper-V and Azure Test Code, ver. 1.0.0
# Copyright (c) Microsoft Corporation
#
# All rights reserved.
# Licensed under the Apache License, Version 2.0 (the ""License"");
# you may not use this file except in compliance with the Licen... | bogdancarpusor/lis-test | WS2012R2/lisa/setupscripts/NMI_Verify_Interrupt.ps1 | PowerShell | apache-2.0 | 6,024 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.