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 |
|---|---|---|---|---|---|
<#
Convert cert with base-64 to c string
#>
if($args.Length -ne 1){
Write-Warning "Usage: certToString.ps1 <.cer file name>"
Exit -1
}
$cert = Get-Content $args[0]
$length = $cert.Length
$loopLength = $length - 1
for($i = 0; $i -lt $loopLength; $i++){
$cert[$i] = "`"$($cert[$i])\r\n`" \"
}
$cert[$length... | mycspring/ClaveChain | Tools/certToString.ps1 | PowerShell | apache-2.0 | 398 |
Function Get-UnitybasicSystemInfo {
<#
.SYNOPSIS
Provides unauthenticated access to system model, system name, software version, and API version information. This is a singleton resource type.
.DESCRIPTION
Provides unauthenticated access to system model, system name, software version, and A... | equelin/Unity-Powershell | Tools/Functions/Result_UnityVSA_41/Get-UnitybasicSystemInfo.ps1 | PowerShell | mit | 2,248 |
task GenerateMarkdown {
$module = Import-Module -FullyQualifiedName $ManifestPath -Force -PassThru
try
{
if ($module.ExportedFunctions.Count -eq 0)
{
'No functions have been exported for this module. Skipping Markdown generation...'
return
}
if (Get... | KevinMarquette/PSGraph | BuildTasks/GenerateMarkdown.Task.ps1 | PowerShell | mit | 1,302 |
Function Create-InternalArmVM
{
Param (
$VMName,
$ResourceGroup,
$Location,
$VMSize,
$VMImage,
$StorageAccount,
$StorageAccountContainer,
$AdminUserName,
$AdminPassword,
$OsType,
$NetworkInterfaceId
)
$Crea... | PSBlue/Blue | VirtualMachine/Create-InternalArmVM.ps1 | PowerShell | mit | 3,332 |
<#
Copyright (c) Microsoft Corporation. All rights reserved.
Licensed under the MIT License. See License.txt in the project root for license information.
#>
<#
.SYNOPSIS
Returns the list of all edge gateways at a certain location.
.DESCRIPTION
Returns the list of all edge gateways at a certain location.
.PAR... | AzureAutomationTeam/azure-powershell | src/StackAdmin/Azs.Fabric.Admin/Module/Azs.Fabric.Admin/Generated.PowerShell.Commands/SwaggerPathCommands/Get-AzsEdgeGateway.ps1 | PowerShell | apache-2.0 | 8,380 |
function FindService
{
param($name)
Get-WmiObject Win32_Service | Where-Object {$_.serviceName -eq $name -or $_.displayName -eq $name}
} | pmenglund/serverspec | lib/serverspec/backend/powershell/support/find_service.ps1 | PowerShell | mit | 140 |
[cmdletbinding()]
param()
# Arrange.
. $PSScriptRoot\..\..\lib\Initialize-Test.ps1
Register-Mock Get-LocalizedString { $OFS = " " ; "$args" }
Register-Mock Get-TaskVariable
$vstestVersion = "14"
Register-Mock SetRegistryKeyForParallel { } -- -vsTestVersion $vstestVersion
$path="$env:VS140COMNTools\..\IDE\CommonExtens... | AArnott/vso-agent-tasks | Tests/L0/VsTest/2015U1Check.ReturnsTrueIfTaefFileIsFound.ps1 | PowerShell | mit | 584 |
#region localizeddata
if (Test-Path "${PSScriptRoot}\${PSUICulture}")
{
Import-LocalizedData `
-BindingVariable LocalizedData `
-Filename MSFT_xVMHardDiskDrive.strings.psd1 `
-BaseDirectory "${PSScriptRoot}\${PSUICulture}"
}
else
{
# fallback to en-US
Import-LocalizedData `
-... | jpogran/puppetlabs-dsc | lib/puppet_x/dsc_resources/xHyper-V/DSCResources/MSFT_xVMHardDiskDrive/MSFT_xVMHardDiskDrive.psm1 | PowerShell | apache-2.0 | 9,063 |
function Exec-CommandCore([string]$command, [string]$commandArgs, [switch]$useConsole = $true) {
$startInfo = New-Object System.Diagnostics.ProcessStartInfo
$startInfo.FileName = $command
$startInfo.Arguments = $commandArgs
$startInfo.UseShellExecute = $false
$startInfo.WorkingDirectory = Get-Location
if ... | paulvanbrenk/roslyn | src/Setup/InstallerScripts/tools/utils.ps1 | PowerShell | apache-2.0 | 5,185 |
$dnsserver = (,"8.8.8.8")
Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE | Invoke-WmiMethod -Name SetDNSServerSearchOrder -ArgumentList (,$dnsserver)
| mitchellh/vagrant-installers | packer/vagrant/floppy/win-8/set-dns.ps1 | PowerShell | mit | 181 |
#requires -modules BuildHelpers
#requires -modules @{ ModuleName = "Pester"; ModuleVersion = "4.4.0" }
Describe "Set-JiraConfigServer" -Tag 'Unit' {
BeforeAll {
Remove-Item -Path Env:\BH*
$projectRoot = (Resolve-Path "$PSScriptRoot/../..").Path
if ($projectRoot -like "*Release") {
... | AtlassianPS/JiraPS | Tests/Functions/Set-JiraConfigServer.Unit.Tests.ps1 | PowerShell | mit | 1,823 |
workflow virtualMachine-Start
{
param (
[Parameter(Mandatory=$true)]
[PSCredential]
$automationUser,
[Parameter(Mandatory=$true)]
[string]
$subscriptionName,
[Parameter(Mandatory=$true)]
[string]
$virtualMachineName
)
Add-Azur... | akamsteeg/AzureScripts | Azure Automation/Virtual Machines/virtualMachine-start.ps1 | PowerShell | mit | 948 |
function Test-UPSBattery
{
<#
.Synopsis
Checks that status of the system battery.
.DESCRIPTION
Long description
.EXAMPLE
Example of how to use this cmdlet
.EXAMPLE
Another example of how to use this cmdlet
.INPUTS
Inputs to this cmdlet (if any)
.OUTPUTS
Output from this cmdlet (if any)
.NOTES
Gene... | Persistent13/Test-UPSBattery | Test-UPSBattery.psm1 | PowerShell | mit | 3,843 |
$packageName = 'sqlserver-odbcdriver'
$installerType = 'msi'
$silentArgs= '/qn /norestart IACCEPTMSODBCSQLLICENSETERMS=YES'
$url = '{link32}'
$url64 = '{link64}'
$checksumType = 'sha256'
$checksum = '{checksum32}'
$checksum64 = '{checksum64}'
Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$ur... | Roemer/Chocolatey-Packages | sqlserver-odbcdriver/tools/chocolateyinstall.ps1 | PowerShell | mit | 413 |
$users = @( 'User Fullname')
$dbs = @( 'DB-NameHere')
$creds = Get-Credential -UserName "DOMAIN\User" -Message 'Gimme dem creds yo'
$server = your.domain.server.net
foreach ($user in $users) {
$aduser = Get-ADUser -Filter { name -Like $user } -Server $server -Credential $creds
foreach ($db in $dbs) {
Add-A... | tscheffe/dotfiles | powershell/scripts/add-users-to-adgroup.ps1 | PowerShell | mit | 361 |
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '', Scope='Class', Target='*')]
class SlackBackend : Backend {
# The types of message that we care about from Slack
# All othere will be ignored
[string[]]$MessageTypes = @(
'channel_rename'
... | poshbotio/PoshBot | PoshBot/Implementations/Slack/SlackBackend.ps1 | PowerShell | mit | 35,566 |
Function Lock-Computer {
<#
.DESCRIPTION
Function to Lock your computer
.SYNOPSIS
Function to Lock your computer.
This is using the win32 user32.dll library.
.EXAMPLE
Lock-Computer
This will lock the current computer
.LINK
https://github.com/lazywinadmin/PowerShell
#>
$signature = @"
[... | lazywinadmin/PowerShell | TOOL-Lock-Computer/Lock-Computer.ps1 | PowerShell | mit | 587 |
. $psScriptRoot\ConvertFrom-Json.ps1 # Overwriting ConvertFrom-JSON to allow for comments within JSON
. $PSScriptRoot\Expand-AzureRMTemplate.ps1
. $PSScriptRoot\Test-AzureRMTemplate.ps1
| tibor19/azure-quickstart-templates | test/template-tests/AzRMTester.psm1 | PowerShell | mit | 198 |
$script:resourceHelperModulePath = Join-Path -Path $PSScriptRoot -ChildPath '../../Modules/DscResource.Common'
$script:moduleHelperPath = Join-Path -Path $PSScriptRoot -ChildPath '../../Modules/DhcpServerDsc.Common'
Import-Module -Name $script:resourceHelperModulePath
Import-Module -Name $script:moduleHelperPath
$scr... | PowerShell/xDhcpServer | source/DSCResources/MSFT_xDhcpServerOptionDefinition/MSFT_xDhcpServerOptionDefinition.psm1 | PowerShell | mit | 12,846 |
<#
.SYNOPSIS
Returns all occurances of pattern in log file
.DESCRIPTION
Checks Event log for pattern and returns the number criticals and warnings that match that pattern.
.Notes
FileName : check-windows-event-log.ps1
Author : Patrice White - patrice.white@ge.com
.LINK
https://github.co... | sensu-plugins/sensu-plugins-windows | bin/check-windows-event-log.ps1 | PowerShell | mit | 1,538 |
function Get-ParentProcessChain ([System.Diagnostics.Process]$Process = [System.Diagnostics.Process]::GetCurrentProcess())
{
$ParentProcessId = (gwmi win32_process -Filter "processid='$($Process.Id)'" -ErrorAction SilentlyContinue).parentprocessid
if ($ParentProcessId)
{
$ParentProcess = Get-Pro... | lars36s/PowerShell | Microsoft.PowerShell_profile.ps1 | PowerShell | mit | 15,456 |
$isISE = $host.Name -eq 'Windows PowerShell ISE Host'
if ($isISE) {
if (-not ($Menu = $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus |
Where-Object { $_.DisplayName -eq 'ISEGit' })) {
$Menu = $psISE.CurrentPowerShellTab.AddOnsMenu.Submenus.Add('ISEGit', $null, $null)
}
}
function Resolve-ISE... | lweniger/PowerShell | Modules/downloaded/powershellgallery/ISEGit/0.1.0.0/ISEGit.psm1 | PowerShell | mit | 5,825 |
function New-DscNode {
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[ValidateNotNullOrEmpty()]
[string]
$WebenrollServer
)
#region variables
$GUID = [System.Guid]::NewGuid().Guid
$WebEnrollURL = "https://$WebenrollServer/ADPolicyProvider_CEP_... | nicholasdille/DSCTooling | PSDSC/Authoring.ps1 | PowerShell | mit | 14,801 |
#
# Swaggy Jenkins
# Jenkins API clients generated from Swagger / Open API specification
# Version: 1.1.2-pre.0
# Contact: blah@cliffano.com
# Generated by OpenAPI Generator: https://openapi-generator.tech
#
Describe -tag 'PSOpenAPITools' -name 'Label1' {
Context 'Label1' {
It 'Initialize-Label1' {
... | cliffano/swaggy-jenkins | clients/powershell/generated/tests/Model/Label1.Tests.ps1 | PowerShell | mit | 541 |
<#
.SYNOPSIS
Deletes one or more Work Item Iterations.
.PARAMETER Iteration
${HelpParam_Iteration}
.PARAMETER MoveTo
Specifies the new iteration path for the work items currently assigned to the iteration being deleted, if any. When omitted, defaults to the root iteration
.PARAMETER Project
${HelpPar... | egomesbrandao/tfscmdlets | src/PS/AreaIteration/Remove-TfsIteration.ps1 | PowerShell | mit | 1,657 |
Push-Location
Set-Location (Split-Path $PSCommandPath -Parent)
Write-Verbose "Checking PAKET..."
./.paket/paket.bootstraper.exe
./.paket/paket.exe restore
if($LASTEXITCODE -gt 0){
Write-Verbose " Error."
return $LASTEXITCODE
}else {
Write-Verbose " Done."
}
./packages/GitVersion.CommandLine/tools/GitVersi... | xunilrj/Collections.SqlServer | build.ps1 | PowerShell | apache-2.0 | 694 |
#
# Copyright 2019 Google Inc.
#
# 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 law or agreed to in wri... | GoogleCloudPlatform/terraform-sqlserver-alwayson | powershell/c2d/gce_base.psm1 | PowerShell | apache-2.0 | 25,258 |
$packageName = 'dolphin'
$url = 'http://dl.dolphin-emu.org/builds/dolphin-master-5.0-3475-x64.7z'
$checksum = 'e73a2c909cb3f540f16e5060da6bb1af155dc9ffc2b61caa4549475e9c37b0ca'
$checksumType = 'sha256'
$url64 = $url
$checksum64 = $checksum
$checksumType64 = $checksumType
$toolsDir = "$(Split-Path -parent $MyInvocation... | dtgm/chocolatey-packages | automatic/_output/dolphin/5.0.3475/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 790 |
$packageName = 'cryptsync'
$installerType = 'msi'
$silentArgs = '/quiet /qn /norestart'
$urlArray = @('https://sourceforge.net/projects/cryptsync-sk/files/1.2.3/CryptSync-1.2.3.msi/download', 'https://sourceforge.net/projects/cryptsync-sk/files/1.2.3/CryptSync64-1.2.3.msi/download')
$url = $urlArray[0]
$checksum = '529... | dtgm/chocolatey-packages | automatic/_output/cryptsync/1.2.3/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 1,043 |
$ErrorActionPreference = 'Stop';
$toolsDir = (Split-Path -Parent $MyInvocation.MyCommand.Definition)
. "$toolsDir\helpers.ps1"
$packageArgs = @{
packageName = 'renamemaster'
fileType = 'zip'
url = 'http://files.snapfiles.com/directdl/rmv314.zip'
checksum = '288def2d13b7509eeb519e78af928b... | jberezanski/chocolatey-coreteampackages | automatic/renamemaster/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 668 |
if (-not (Test-Path $env:SYSTEMDRIVE\Ubuntu)) {
Write-Output "Downloading and installing Ubuntu 20.04 ..."
New-Item -Type Directory -Path $env:SYSTEMDRIVE\Ubuntu | Out-Null
if (Test-Path $env:TEMP\ubuntu.zip) {
Remove-Item -Path $env:TEMP\ubuntu.zip -Force | Out-Null
}
if (Test-Path $env:TEMP\ubuntu) {... | dcjulian29/choco-packages | wsl-ubuntu/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 1,770 |
function Diff-Excel {
<#
.SYNOPSIS
PowerShell wrapper for ExcelConmpare a tool to diff excel files
.DESCRIPTION
PowerShell wrapper for ExcelCompare.
Generates row/column wise diffs conmparing two .xlsx files
This function requires excel_cmp.bat
https://github.com/na-ka-na... | DBremen/PowerShellScripts | Binary Wrapper/Diff-Excel.ps1 | PowerShell | mit | 4,192 |
#Get public and private function definition files.
$Public = @( Get-ChildItem -Path $PSScriptRoot\Public\ -Include *.ps1 -Recurse -ErrorAction SilentlyContinue )
$Private = @( Get-ChildItem -Path $PSScriptRoot\Private\ -Include *.ps1 -Recurse -ErrorAction SilentlyContinue )
#Dot source the files
Foreach($import in @(... | ngetchell/PSPushover | PSPushover/PSPushover.psm1 | PowerShell | mit | 654 |
$packageName = 'telegram.install'
$installerType = 'exe'
$url = 'https://updates.tdesktop.com/tsetup/tsetup.0.8.13.exe'
$checksum = '61a6f5e24d4740caad560889ecac100f57eecba0'
$checksumType = 'sha1'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$validExitCodes = @(0)
Install-ChocolateyPackage -PackageN... | dtgm/chocolatey-packages | automatic/_output/telegram.install/0.8.13/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 655 |
<#
File: Sherlock.ps1
Author: @_RastaMouse
License: GNU General Public License v3.0
#>
$Global:ExploitTable = $null
function Get-FileVersionInfo ($FilePath) {
$VersionInfo = (Get-Item $FilePath).VersionInfo
$FileVersion = ( "{0}.{1}.{2}.{3}" -f $VersionInfo.FileMajorPart, $VersionInfo.FileMinor... | Hackplayers/Empire-mod-Hpys-tests | data/module_source/privesc/Sherlock.ps1 | PowerShell | bsd-3-clause | 16,947 |
Function Get-GitLabUserKey {
[cmdletbinding(DefaultParameterSetName='All')]
[OutputType('GitLab.User.Key')]
param(
[Parameter(ParameterSetName='All')]
[switch]$All,
[Parameter(ParameterSetName='Key')]
[int]$Key,
[Parameter(ParameterSetName='Username')]
[str... | TerrapinStation/PSGitLab | PSGitLab/Public/Keys/Get-GitLabUserKey.ps1 | PowerShell | mit | 970 |
[cmdletbinding(SupportsShouldProcess=$true)]
param($publishProperties=@{}, $packOutput, $pubProfilePath)
# to learn more about this file visit https://go.microsoft.com/fwlink/?LinkId=524327
try{
if ($publishProperties['ProjectGuid'] -eq $null){
$publishProperties['ProjectGuid'] = '2f22be8d-acb8-4f0d-866a... | kshyju/ProjectPlanningTool | src/TeamBins.Web/Properties/PublishProfiles/teambins2 - Web Deploy-publish.ps1 | PowerShell | apache-2.0 | 774 |
param($installPath, $toolsPath, $package, $project)
$global:InstallVar = $global:InstallVar + 1 | mrward/NuGet.V2 | test/EndToEnd/Packages/InstallPackageIgnoreInitScriptIfItIsNotDirectlyUnderTools2/files/TestTargetFxInvalidInitScript.1.0.0/tools/net30/install.ps1 | PowerShell | apache-2.0 | 96 |
function Get-SqlDefaultPaths {
<#
.SYNOPSIS
Internal function. Returns the default data and log paths for SQL Server. Needed because SMO's server.defaultpath is sometimes null.
#>
[CmdletBinding()]
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseSingularNouns", "")]
param (
... | dsolodow/dbatools | internal/functions/Get-SqlDefaultPaths.ps1 | PowerShell | mit | 2,056 |
@{
Name = 'PSEverything'
Description = 'Fast PowerShell searches through VoidTools Everything Search'
Company = 'Austin Wagner'
Copyright = '(c) 2014 Austin Wagner. All rights reserved.'
Version = '0.1.0'
}
| austinwagner/PSEverything | TemplateParameters.ps1 | PowerShell | mit | 208 |
using namespace Microsoft.Windows.PowerShell.ScriptAnalyzer.Generic
using namespace System.Management.Automation.Language
function AvoidNestedFunctions {
<#
.SYNOPSIS
AvoidNestedFunctions
.DESCRIPTION
Functions should not contain nested functions.
#>
[CmdletBinding()]
[OutputT... | indented-automation/ScriptAnalyzerRules | Indented.ScriptAnalyzerRules/public/rules/AvoidNestedFunctions.ps1 | PowerShell | mit | 899 |
<#
.EXAMPLE
This example performs a custom SQL Server Reporting Services configuration.
It will initialize SQL Server Reporting Services and register the below
custom Report Server Web Service and Report Manager URLs and enable SSL.
Report Server Web Service: https://localhost:443/MyReportServer ()
... | PowerShell/xSQLServer | Examples/Resources/SqlRS/3-CustomConfigurationUsingSsl.ps1 | PowerShell | mit | 1,071 |
#region Functions
### Dot Source our functions
. $PSScriptRoot\Functions\Write-TraceLogString.ps1
#endregion Functions
### Export all functions/cmdlets
Export-ModuleMember -Function * -Cmdlet *
| ryguy25/PowerShell_Module_ErrorLogging | ErrorLogging.psm1 | PowerShell | mit | 197 |
#
# ExportSolution.ps1
#
param(
[string]$CrmConnectionString,
[string]$SolutionName,
[bool]$ExportManaged,
[bool]$ExportUnmanaged = $true,
[string]$TargetVersion,
[string]$ExportSolutionOutputPath,
[bool]$UpdateVersion,
[string]$RequiredVersion,
[int]$Timeout,
[bool]$ExportIncludeVersionInSolutionName,
[bool]$ExportA... | WaelHamze/xrm-ci-framework | CRM365/Xrm.Framework.CI/Xrm.Framework.CI.PowerShell.Scripts/ExportSolution.ps1 | PowerShell | mit | 4,782 |
<#
### Task
Create a Traffic Manager Profile that will load balance between two web apps based on performance.
### Details
When performance load balancing is enabled users will be redirected to a web app instance that is closer to them.
Standard web app plans (or higher) must be used.
### Initial Inf... | newventuresoftware/passing-azure-70-532 | powershell/arm/traffic-manager/traffic-manager-performance.ps1 | PowerShell | mit | 2,137 |
<#
.SYNOPSIS
vSphere VM Cost Showback Tool
.DESCRIPTION
Enumerates all VMs and calculates their cost which is then added to each VMs notes field in vCenter.
All VMs are then also output to a timestamped CSV file as well for trending reporting and history.
This allows you to estimate your per workload/VM costs ... | ieeeglobalspec/vsphere-showback | vsphere-showback.ps1 | PowerShell | mit | 8,308 |
# Copyright 2021 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 law o... | googleprojectzero/sandbox-attacksurface-analysis-tools | NtObjectManager/KerberosFunctions.ps1 | PowerShell | apache-2.0 | 8,672 |
$p = @{
Name = "ImportExcel"
NuGetApiKey = $NuGetApiKey
LicenseUri = "https://github.com/dfinke/ImportExcel/blob/master/LICENSE.txt"
Tag = "Excel","EPPlus","Export","Import"
ReleaseNote = "Now you can read Excel files even if they're open in Excel"
ProjectUri = "https://github.com/dfinke/Import... | powercode/ImportExcel | PublishToGallery.ps1 | PowerShell | apache-2.0 | 347 |
#
# Module manifest for module 'PSGet_AzureRM.Tags'
#
# Generated by: Microsoft Corporation
#
# Generated on: 4/3/2017
#
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '0.9.0'
# Supported PSEditions
CompatiblePSEditions = 'C... | atpham256/azure-powershell | src/ResourceManager/Tags/AzureRM.Tags.Netcore.psd1 | PowerShell | apache-2.0 | 4,390 |
#region: Test-IP
<#
.Synopsis
Tests IP Connectivity on given port
.Description
Tests IP Connectivity on given port.
Test returns $True or throws an error.
.Parameter IP
IP Address of your system to Test
.Parameter Port
Port to Test
.Example
Test-IP -IP 192.168.2.1 -Port 8443
.Ex... | mycloudrevolution/StoreOnce-PSModule | PS-StoreOnce/Functions/Test-IP.psm1 | PowerShell | apache-2.0 | 916 |
properties {
$base_dir = resolve-path .
$lib_dir = "$base_dir\SharedLibs"
$build_dir = "$base_dir\build"
$sln_file = "$base_dir\Rhino.Mocks.sln"
$version = "3.6.3.0"
$humanReadableversion = "3.6.3"
$tools_dir = "$base_dir\Tools"
$release_dir = "$base_dir\Release"
$uploadCategory = "Rhino-Mocks"... | alaendle/rhino-mocks | default.ps1 | PowerShell | bsd-3-clause | 4,502 |
$script:DSCModuleName = 'xSQLServer'
$script:DSCResourceName = 'MSFT_xSQLServerMemory'
#region HEADER
# Unit Test Template Version: 1.2.0
$script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot)
if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Te... | seizste/xSQLServer | Tests/Unit/MSFT_xSQLServerMemory.Tests.ps1 | PowerShell | mit | 33,232 |
@{
GUID="CA046F10-CA64-4740-8FF9-2565DBA61A4F"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation. All rights reserved."
ModuleVersion="6.1.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Get-WinEvent", "New-WinEv... | Cowmonaut/PowerShell | src/Modules/Windows/Microsoft.PowerShell.Diagnostics/Microsoft.PowerShell.Diagnostics.psd1 | PowerShell | mit | 665 |
# Copyright 2011 Splunk, Inc.
#
# 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 law or agreed to in wri... | splunk/splunk-reskit-powershell | Source/Tests/Splunk.Utility.Tests.ps1 | PowerShell | apache-2.0 | 3,659 |
<#
.SYNOPSIS
Generates the C# source code for logarithmic arithmetic operators.
.PARAMETER className
The name of the unit.
.PARAMETER baseUnitFieldName
The name of the backing field used to store the unit's value.
.PARAMETER baseType
The data type of the backing field used to store the unit's value.
.PARAMETER scal... | Tirael/UnitsNet | UnitsNet/Scripts/Include-GenerateLogarithmicCode.ps1 | PowerShell | mit | 3,756 |
<#
The MIT License (MIT)
Copyright (c) 2015 Objectivity Bespoke Software Specialists
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
t... | ObjectivityBSS/PSCI | PSCI/Public/deploy/Helpers/ConfigFiles/Protect-WebConfig.ps1 | PowerShell | mit | 2,305 |
<#
.SYNOPSIS
Tests redis cache.
#>
function Test-RedisCache
{
# Setup
$resourceGroupName = "PowerShellTest-1"
$cacheName = "powershelltest"
$location = "West US"
# Create resource group
New-AzureRmResourceGroup -Name $resourceGroupName -Location $location
# Creating Cache
$cacheCreated = Ne... | zhencui/azure-powershell | src/ResourceManager/RedisCache/Commands.RedisCache.Test/ScenarioTests/RedisCacheTests.ps1 | PowerShell | apache-2.0 | 28,492 |
$script:HypervisorFactory = [VMLib.Hypervisor.HypervisorFactory]::GetInstance()
foreach($file in Get-ChildItem -Path $PSScriptRoot -File)
{
if($file.Extension -eq ".ps1"){
. $file.FullName
}
} | wiltaylor/VMLib | Src/PSVMLib/PSVMLib.psm1 | PowerShell | mit | 198 |
[Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSAvoidUsingConvertToSecureStringWithPlainText', '')]
param ()
$script:dscModuleName = 'xPSDesiredStateConfiguration'
$script:dscResourceName = 'DSC_xGroupResource'
function Invoke-TestSetup
{
try
{
Import-Module -Name DscResource.Test -Force -ErrorA... | PowerShell/xPSDesiredStateConfiguration | tests/Unit/DSC_xGroupResource.Tests.ps1 | PowerShell | mit | 139,461 |
<#
.SYNOPSIS
Given a C# Angular project that is already set up, add an angular service for basic CRUD and filter operations against a backend REST API representing a table.
.DESCRIPTION
This will create the service TS file, build in the asynchronous calls to the REST API calls, and add all the required import a... | brianwoelfel/BoxTurtlePs | BoxTurtlePs/Public/New-NgCrudService.ps1 | PowerShell | mit | 1,858 |
<#PSScriptInfo
.VERSION 1.0.1
.GUID f57b22a3-b2bd-4fb5-9fa0-3997055d4577
.AUTHOR Microsoft Corporation
.COMPANYNAME Microsoft Corporation
.COPYRIGHT
.TAGS DSCConfiguration
.LICENSEURI https://github.com/dsccommunity/xPSDesiredStateConfiguration/blob/main/LICENSE
.PROJECTURI https://github.com/dsccommunity/xPSDesiredSta... | PowerShell/xPSDesiredStateConfiguration | source/Examples/Resources/xRemoteFile/2-xRemoteFile_DownloadFileUsingProxy_Config.ps1 | PowerShell | mit | 3,504 |
Param
(
[switch] $AllVersionsAsStreams
)
Import-Module au
Import-Module "$PSScriptRoot\..\tools\PSModules\DotNetPackageTools\DotNetPackageTools.psm1"
function global:au_SearchReplace {
@{
"$PSScriptRoot\$($Latest.PackageName).nuspec" = @{
'\[.+Release\s+Notes\]\([^)]+\)' = '[{0} Release No... | jberezanski/dotnetcore-chocolateypackages | dotnet/Update.ps1 | PowerShell | mit | 1,667 |
$args = 'describe', '--tags', '--always'
$cmd = 'git'
$tag = & $cmd $args
$version = $tag.TrimStart('v')
$args = "/DVERSION=$version", "installer.nsi"
$cmd = "$env:NSIS_HOME\makensis.exe"
& $cmd $args
| EnviroCentre/monitoring-module | installer/win/binst.ps1 | PowerShell | mit | 211 |
# revisit this https://blogs.msdn.microsoft.com/spses/2015/09/15/cloud-hybrid-search-service-application/
function Get-TargetResource
{
[CmdletBinding()]
[OutputType([System.Collections.Hashtable])]
# Ignoring this because we need to generate a stub credential to return up the current crawl account as a PS... | wulfland/xSharePoint | Modules/xSharePoint/DSCResources/MSFT_xSPSearchServiceApp/MSFT_xSPSearchServiceApp.psm1 | PowerShell | mit | 11,336 |
function Get-DscEventLog
{
param ($Session)
icm $Session -script {
get-winevent -LogName Microsoft-Windows-DSC/Operational -force -Oldest |
sort TimeCreated -desc
} |
select logname, TimeCreated, Message
}
| brianehlert/PoSh.org-DSC | Tooling/DscDeployment/Get-DscEventLog.ps1 | PowerShell | mit | 251 |
function Set-Version {
param(
[string] $csprojPattern,
[string] $version
)
$versionTag = "VersionPrefix";
Get-ChildItem $csprojPattern | ForEach-Object {
$csproj = Get-Content -Raw -Path $_.FullName
$originalVersion = [regex]::match($csproj, "<$versionTag>(.*)</$versionTag>").Groups[1].Value
$csproj.Replace(... | dstockhammer/Brighter | Set-Version.psm1 | PowerShell | mit | 502 |
function Send-IoTDeviceMessage {
<#
.SYNOPSIS
Sends a message from the device to the IoT Hub.
.DESCRIPTION
See the Synopsis.
.EXAMPLE
Send-IoTDeviceMessage -messageString "Hello world" -deviceClient $deviceClient
#>
[cmdletbinding()]
param(
$messageString = "Foo",
$de... | markscholman/AzureIoT | Functions/Send-IoTDeviceMessage.ps1 | PowerShell | mit | 492 |
<#
.NOTES
===========================================================================
Created on: 04.10.2015
Created by: David das Neves
Version: 0.1
Project: PSGUI_Manager
Filename: PSGUI_Manager.psm1
===========================... | ddneves/PSGUI | Project PSGUI/PSGUI/PSGUI_Manager/PSGUI_Manager.psm1 | PowerShell | mit | 1,787 |
function Get-Neo4jPropertyKey {
<#
.SYNOPSIS
Get all property keys in a Neo4j database
.DESCRIPTION
Get all property keys in a Neo4j database
.EXAMPLE
Get-Neo4jPropertyKey
.PARAMETER As
Parse the Neo4j response as...
Parsed: We attempt to parse the outp... | RamblingCookieMonster/PSNeo4j | PSNeo4j/Public/Get-Neo4jPropertyKey.ps1 | PowerShell | mit | 2,612 |
#####
# Copyright 2016 Aaron Morelli
#
# 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 law or ag... | AaronMorelli/ChiRho | Uninstall_ChiRho.ps1 | PowerShell | apache-2.0 | 7,020 |
#Requires -RunAsAdministrator
$instanceName = "particular-workshop"
sqllocaldb stop $instanceName
sqllocaldb delete $instanceName
$databasesPath = "$ENV:UserProfile\particular-workshop-databases"
mkdir -Force $databasesPath
rm -Recurse $databasesPath | adamralph/Workshop.Microservices | exercises/scripts/Teardown-LocalDBInstance.ps1 | PowerShell | apache-2.0 | 256 |
<#
#>
# 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 law or agreed to in writing, software
# dis... | pshdo/Carbon | Get-PrivilegeList.ps1 | PowerShell | apache-2.0 | 1,175 |
$pkg_name = "health-check-performance-04"
$pkg_origin = "habitat-testing"
$pkg_maintainer = "The Habitat Maintainers <humans@habitat.sh>"
$pkg_version = "0.0.0"
| habitat-sh/habitat | test/fixtures/health-check-performance/health-check-performance-04/x86_64-windows/plan.ps1 | PowerShell | apache-2.0 | 161 |
<#
.SYNOPSIS
This PowerShell script module file provides a step function to be used in a
series of executable PowerShell steps that is intended to be included in all
main PowerShell scripts that reside within the automation framework.
.DESCRIPTION
Note: This script module is NOT intended to be executed independent of ... | ChrisJaehnen/dev-tools-script-console | Steps/Start/Start-ConcourseWeb.psm1 | PowerShell | apache-2.0 | 1,909 |
Describe 'The nomad application' {
Context 'is installed' {
It 'with binaries in /usr/local/bin' {
'/usr/local/bin/nomad' | Should Exist
}
It 'with default configuration in /etc/nomad-conf.d/client.hcl' {
'/etc/nomad-conf.d/client.hcl' | Should Exist
... | Calvinverse/resource.container.host.linux | tests/integration/pester/Nomad.Tests.ps1 | PowerShell | apache-2.0 | 3,104 |
# Copyright 2012 Aaron Jensen
#
# 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 law or agreed to ... | MattHubble/carbon | Carbon/HostsFile/Set-HostsEntry.ps1 | PowerShell | apache-2.0 | 6,454 |
param($installPath, $toolsPath, $package, $project)
. "$toolsPath\ProjectFileTransform.ps1"
if ($project -eq $null) { Exit }
# Delete bogus content file that serves to start this script
$project.ProjectItems | Where { $_.Name -eq "TypeScript.MSBuild.readme.txt" } | ForEach-Object { $_.Delete() }
# Save any current ... | Thorarin/TypeScript.MSBuild | source/Typescript.MSBuild/tools/Install.ps1 | PowerShell | apache-2.0 | 523 |
$packageName = 'kvrt'
$url = 'http://devbuilds.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe'
$checksum = '735b45b3bcdd2d055c760a43e8327c0c56e9c19da5b2312b53c00c990f635389'
$checksumType = 'sha256'
$toolsPath = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
$installFile = Join-Path $toolsPath "kvr... | dtgm/chocolatey-packages | automatic/_output/kvrt/2016.08.01.0316/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 960 |
$packageName = 'wnetwatcher.install'
$installerType = 'exe'
$url = 'http://www.nirsoft.net/utils/wnetwatcher_setup.exe'
$checksum = 'b433a884aa0fc5ef073a85feeff26fff2fe1b4302b0be63acaf101ae398ce679'
$checksumType = 'sha256'
$silentArgs = '/S'
$validExitCodes = @(0)
Install-ChocolateyPackage -PackageName "$packageName... | dtgm/chocolatey-packages | automatic/_output/wnetwatcher.install/2.03/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 640 |
#
# Copyright (c) 2011-2012, Toji Project Contributors
#
# Dual-licensed under the Apache License, Version 2.0, and the Microsoft Public License (Ms-PL).
# See the file LICENSE.txt for details.
#
# This file is where you can override any settings specified in the other scripts.
# These settings can also be used to... | taliesins/talifun-commander | build/overrides.ps1 | PowerShell | apache-2.0 | 537 |
@{
# Version number of this module.
ModuleVersion = '1.0.0.0'
# ID used to uniquely identify this module
GUID = '7c3fee65-807c-4c25-8f60-0dbece96d1bb'
# Author of this module
Author = 'Microsoft Corporation'
# Company or vendor of this module
CompanyName = 'Microsoft Corporation'
# Copyright statement ... | cyberious/puppetlabs-dsc | lib/puppet_x/dsc_resources/xMySql/xMySql.psd1 | PowerShell | apache-2.0 | 981 |
$packageName = 'firefox-nightly'
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$url = 'https://archive.mozilla.org/pub/firefox/nightly/latest-mozilla-central/firefox-58.0a1.en-US.win32.installer.exe'
$checksum = 'f1ac297c5de919d2b55c62d71d39a377eea210307c9a1ecc64ccdbcad17edde5'
$c... | dtgm/chocolatey-packages | automatic/_output/firefox-nightly/58.0.1.2017101713/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 1,131 |
function New-WmiEventFilter
{
[CmdletBinding()]
Param(
#region CommonParameters
[Parameter(ParameterSetName = 'ByComputerName')]
[ValidateNotNullOrEmpty()]
[string[]]
$ComputerName = 'localhost',
[Parameter(ParameterSetName = 'ByComputerName')]
[Managem... | Invoke-IR/WmiEvent | Cmdlets/New-WmiEventFilter.ps1 | PowerShell | bsd-3-clause | 2,425 |
<#
* Copyright (c) Inish Technology Ventures Limited. All rights reserved.
*
* This code is licensed under the BSD 3-Clause License included with this source
*
* ALSO SEE: https://github.com/SoftwarePotential/samples/wiki/License
#>
$scriptPath = split-path -parent $MyInvocation.MyCommand.Definition
$pfx = Join-Path... | SoftwarePotential/BuildIntegration | Sp.Samples.BuildIntegration/Sp.Samples.BuildIntegration/InstallPfx.ps1 | PowerShell | bsd-3-clause | 1,275 |
@{
# Script module or binary module file associated with this manifest
ModuleToProcess = 'PowerSCCM.psm1'
# Version number of this module.
ModuleVersion = '1.0'
# ID used to uniquely identify this module
GUID = '0ac82760-3e0d-4124-bd1c-92c8dab97171'
# Author of this module
Author = '@harmj0y', '@jaredcatkinson', '@... | PowerShellMafia/PowerSCCM | PowerSCCM.psd1 | PowerShell | bsd-3-clause | 2,081 |
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
#
# Functional tests to verify basic conditions for IO to the powershell.config.json files
# The properties files are supported on non-Windows OSes, but the tests are specific to
# Windows so that file IO can be verified using... | Cowmonaut/PowerShell | test/powershell/engine/Basic/PropertyAccessor.Tests.ps1 | PowerShell | mit | 4,699 |
function GetBuildSystem {
[OutputType([String])]
param ( )
if ($env:APPVEYOR -eq $true) { return 'AppVeyor' }
if ($env:JENKINS_URL) { return 'Jenkins' }
return 'Desktop'
} | indented-automation/BuildTools | Indented.Build/private/GetBuildSystem.ps1 | PowerShell | mit | 200 |
$packageName = 'kcleaner'
$installerType = 'exe'
$silentArgs = '/VERYSILENT /SUPPRESSMSGBOXES /NORESTART /SP-'
$url = 'http://www.kcsoftwares.com/files/kcleaner_lite.exe'
$checksum = 'e7b36264d3190fa0b1d06cce7c28b051d30126bb'
$checksumType = 'sha1'
$validExitCodes = @(0)
Install-ChocolateyPackage -PackageName "$packag... | dtgm/chocolatey-packages | automatic/_output/kcleaner/2.6.4.66/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 643 |
$env:JAVA_HOME="C:\Program Files\Java\jdk1.8.0"
$env:PYTHON="C:\Python27-x64"
$env:PATH="$($env:PYTHON);$($env:PYTHON)\Scripts;$($env:JAVA_HOME)\bin;$($env:PATH)"
$env:CCM_PATH="C:\Users\appveyor\ccm"
Write-Host "Install..."
# Install Ant and Maven
Start-Process cinst -ArgumentList @("-y","ant") -Wait -NoNewWindow
# ... | jorgebay/csharp-driver | appveyor_install.ps1 | PowerShell | apache-2.0 | 3,014 |
$packageName = 'regjump'
$url = 'https://download.sysinternals.com/files/regjump.zip'
$checksum = 'c254e83991a524a8bef68179a83f55215a1c856d'
$checksumType = 'sha1'
$url64 = "$url"
$checksum64 = "$checksum"
$checksumType64 = "checksumType"
$toolsDir = "$(Split-Path -parent $MyInvocation.MyCommand.Definition)"
Install-Ch... | dtgm/chocolatey-packages | automatic/_output/regjump/1.1/tools/chocolateyInstall.ps1 | PowerShell | apache-2.0 | 1,182 |
#
# Module manifest for module 'DSCResources'
#
# Generated by: kborle
#
# Generated on: 6/2/2017
#
@{
# Script module or binary module file associated with this manifest.
# RootModule = ''
# Version number of this module.
ModuleVersion = '1.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID used to uniq... | PowerShell/PSScriptAnalyzer | Tests/Rules/DSCResourceModule/DSCResourceModule.psd1 | PowerShell | mit | 3,738 |
Function New-OutputFolder {
<#
.SYNOPSIS
Function intended for preparing a PowerShell object for output/create folders for e.g. reports or logs.
.DESCRIPTION
Function intended for preparing a PowerShell custom object what contains e.g. folder name for output/create folders. The name is prepared based ... | it-praktyk/New-OutputObject | Public/New-OutputFolder.ps1 | PowerShell | mit | 6,906 |
# **********************************************************************************************
# This sample PowerShell gets the settings you'll need for the app.config file
# **********************************************************************************************
# ********************************************... | ailn/azure-sdk-for-net | src/KeyVault/Microsoft.Azure.KeyVault.Samples/scripts/GetAppConfigSettings.ps1 | PowerShell | apache-2.0 | 5,809 |
Describe "Get-ChildItem" -Tags "CI" {
Context 'FileSystem provider' {
It "Should list the contents of the current folder" {
(Get-ChildItem .).Name.Length | Should BeGreaterThan 0
}
It "Should list the contents of the home directory" {
pushd $HOME
(Get-C... | bingbing8/PowerShell | test/powershell/Modules/Microsoft.PowerShell.Management/Get-ChildItem.Tests.ps1 | PowerShell | mit | 2,023 |
param($installPath, $toolsPath, $package, $project)
$item = $project.ProjectItems | where-object {$_.Name -eq "FodyWeavers.xml"}
$item.Properties.Item("BuildAction").Value = [int]0 | ChaseFlorell/hockey-app | src/packages/Fody.2.1.2/Tools/install.ps1 | PowerShell | mit | 184 |
# File: unit_test_utilities.ps1
# Author: Marvin Smith
# Date: 1/27/2014
#
# Purpose: Contains utility functions for unit test output
#
#---------------------------------------------#
#- Print Unit Test Header -#
#---------------------------------------------#
Function print-un... | marvins/LLNMS | test/powershell/unit_test/unit_test_utilities.ps1 | PowerShell | mit | 3,742 |
param(
[Parameter(Mandatory=$true)]
[string]$output,
[switch]$stable = $false,
[string]$versionSuffix = $null,
[switch]$symbols = $false
)
$projects = @(
"MorseL",
"MorseL.Common",
"MorseL.Common.WebSockets",
"MorseL.Diagnostics",
"MorseL.Client",
"MorseL.Sockets",
"Mors... | ryanwersal/MorseL | pack.ps1 | PowerShell | mit | 1,052 |
#Requires -Version 4.0
function Publish-MrMOFToSMB {
<#
.SYNOPSIS
Publishes a DSC MOF configuration file to the pull server that's configured on a target node(s).
.DESCRIPTION
Publish-MrMOFToSMB is an advanced PowerShell function that publishes one or more MOF configuration files
to the an SMB DSC serve... | mikefrobbins/DSC | MrDSC/Publish-MrMOFToSMB.ps1 | PowerShell | mit | 4,747 |
param($installPath, $toolsPath, $package, $project)
. (Join-Path $toolsPath common.ps1)
# Update the _references.js file
Remove-Reference $scriptsFolderProjectItem $modernizrFileNameRegEx
# SIG # Begin signature block
# MIIdkgYJKoZIhvcNAQcCoIIdgzCCHX8CAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4... | MicrosoftLearning/20486-DevelopingASPNETMVCWebApplications | Allfiles/20486C/Mod05/LabFiles/PhotoSharingApplication_05_begin/packages/Modernizr.2.6.2/Tools/uninstall.ps1 | PowerShell | mit | 10,822 |
# Get the current execution path
Function workingdir{
$fullPathIncFileName = $MyInvocation.MyCommand.Definition
$currentScriptName = $MyInvocation.MyCommand.Name
$currentExecutingPath = $fullPathIncFileName.Replace($currentScriptName, "")
}
$errfile = $currentExecutingPath + "errlist$(get-date -f yyyy-MM-dd-HH-mm)... | erll/Powershell-Scripts | NonEws/get-disconnectedmailbox.ps1 | PowerShell | mit | 1,044 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.