full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/PowerShellGallery/hashdata/1.0.0.0/Tests/Assert-ScriptString.Tests.ps1
Assert-ScriptString.Tests.ps1
$modulePath = Split-Path $PSScriptRoot -Parent $modulepath = Join-Path -Path $modulePath -ChildPath hashdata.psd1 Import-Module $modulePath #cd C:\Users\tore\Dropbox\SourceTreeRepros\HashData ; import-module .\HashData.psd1 Describe "Assert-ScriptString" { $asserted ...
PowerShellCorpus/PowerShellGallery/O365Extensions/0.2.29/helpers/Connect-O365Skype.ps1
Connect-O365Skype.ps1
function Connect-O365Skype { PARAM ( [System.Management.Automation.PSCredential] $Credential ) try { Import-Module -Name SkypeOnlineConnector -DisableNameChecking -Force -ErrorAction Stop } catch { Write-Error -Message "The module 'SkypeOnlineConnector' w...
PowerShellCorpus/PowerShellGallery/O365Extensions/0.2.29/helpers/Connect-O365Sharepoint.ps1
Connect-O365Sharepoint.ps1
function Connect-O365Sharepoint { PARAM ( [System.Management.Automation.PSCredential] $Credential, [string] $TenantName ) try { Import-Module -Name Microsoft.Online.Sharepoint.Powershell -DisableNameChecking -Force -ErrorAction Stop } catch { ...
PowerShellCorpus/PowerShellGallery/O365Extensions/0.2.29/helpers/Connect-O365AzureAD.ps1
Connect-O365AzureAD.ps1
function Connect-O365AzureAD { <# .NOTES Currently supports the MSOnline module - should eventually support the AzureAD module as well, and will check to see which one is installed. If both, then AzureAD will be preferred. #> PARAM ( [System.Management.Automation.PSCredential] ...
PowerShellCorpus/PowerShellGallery/O365Extensions/0.2.29/helpers/Connect-O365Exchange.ps1
Connect-O365Exchange.ps1
function Connect-O365Exchange { PARAM ( [System.Management.Automation.PSCredential] $Credential ) $ExchParams = @{ ConfigurationName = 'microsoft.exchange' ConnectionUri = "https://$ExchComputerName/powershell-liveid/" Credential = $Credential ...
PowerShellCorpus/PowerShellGallery/O365Extensions/0.2.29/helpers/Connect-O365Compliance.ps1
Connect-O365Compliance.ps1
function Connect-O365Compliance { PARAM ( [System.Management.Automation.PSCredential] $Credential ) $ComplianceParams = @{ ConfigurationName = 'Microsoft.Exchange' ConnectionUri = "https://$ComplianceComputerName/powershell-liveid/" Credential = $Credential ...
PowerShellCorpus/PowerShellGallery/O365Extensions/0.2.29/functions/Connect-O365.ps1
Connect-O365.ps1
function Connect-O365 { [CmdletBinding()] PARAM ( [parameter(Mandatory = $true)] [ValidateSet("AzureActiveDirectory","Exchange","ComplianceCenter","Sharepoint","Skype","*")] [string[]] $Services, [parameter(Mandatory = $true)] [System.Management.Automation.Cr...
PowerShellCorpus/PowerShellGallery/O365Extensions/0.2.29/functions/Disconnect-O365.ps1
Disconnect-O365.ps1
function Disconnect-O365 { [CmdletBinding()] PARAM ( [parameter(Mandatory = $true)] [ValidateSet("AzureActiveDirectory","Exchange","ComplianceCenter","Sharepoint","Skype","*")] [string[]] $Services ) if ($Services -eq "*") { $Services = $AllServices }...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Install-FromMsi.ps1
Install-FromMsi.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Downloads an installs a MSI package. .Description Downloads a...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Get-VSBuildTools2015InstallationPath.ps1
Get-VSBuildTools2015InstallationPath.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Retrieves the location of a Visual Studio Build Tools 2015 installati...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Install-Flex.ps1
Install-Flex.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Installs flex. .Description Downloads the specified release o...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Install-Gperf.ps1
Install-Gperf.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Installs gperf. .Description Downloads the specified release ...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Select-VSEnvironment.ps1
Select-VSEnvironment.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Selects and initializes the Visual Studio environment for use. ....
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Install-VSBuildTools2015.ps1
Install-VSBuildTools2015.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Installs Visual Studio Build Tools 2015. .Description Downloa...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Get-SourceCodeRelease.ps1
Get-SourceCodeRelease.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Retrieves the source code for a project. .Parameter Name The ...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Get-VSBuildTools2017InstallationPath.ps1
Get-VSBuildTools2017InstallationPath.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Retrieves the location of a Visual Studio Build Tools 2017 installati...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Install-Bison.ps1
Install-Bison.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Installs bison. .Description Downloads the specified release ...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Get-VSBuildTools2015VCVarsAllPath.ps1
Get-VSBuildTools2015VCVarsAllPath.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Retrieves the default location for `vcvarsall.bat` within Visual Stud...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Expand-SourceArchive.ps1
Expand-SourceArchive.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Expands a source code archive. .Description Recursively expan...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Install-Git.ps1
Install-Git.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Installs Git for Windows. .Description Downloads the specifie...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Get-WebKitGitHubUrl.ps1
Get-WebKitGitHubUrl.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Retrieves the location of WebKit's GitHub mirror. #> Function Get-W...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Update-ScriptPath.ps1
Update-ScriptPath.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Updates the `env:PATH` variable to the current machine's value. ...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Get-WebKitSVNSnapshotUrl.ps1
Get-WebKitSVNSnapshotUrl.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Retrieves the location of WebKit's SVN snapshot. #> Function Get-We...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Initialize-VSEnvironment.ps1
Initialize-VSEnvironment.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Initializes the Visual Studio C++ environment. .Description P...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Get-WebKitGitUrl.ps1
Get-WebKitGitUrl.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Retrieves the location of WebKit's git repository. #> Function Get-...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Install-Ruby.ps1
Install-Ruby.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Installs Ruby. .Description Downloads the specified release o...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Register-SystemPath.ps1
Register-SystemPath.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Registers a path on the host system. .Description Adds a path...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Get-VSBuildTools2017VCVarsAllPath.ps1
Get-VSBuildTools2017VCVarsAllPath.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Retrieves the location for `vcvarsall.bat` within Visual Studio Build...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Install-SVN.ps1
Install-SVN.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Installs TortoiseSVN. .Description Downloads the specified re...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Initialize-NinjaEnvironment.ps1
Initialize-NinjaEnvironment.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Initializes the Ninja build environment. .Description Powersh...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Invoke-CMakeBuild.ps1
Invoke-CMakeBuild.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Invokes a CMake Build. .Description Powershell wrapper for ca...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Install-CMake.ps1
Install-CMake.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Installs CMake. .Description Downloads the specified release ...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Install-Perl.ps1
Install-Perl.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Installs Strawberry Perl. .Description Downloads the specifie...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Install-VSBuildTools2017.ps1
Install-VSBuildTools2017.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Installs Visual Studio Build Tools 2017. .Description Downloa...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Install-Python.ps1
Install-Python.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Installs Python. .Description Downloads the specified release...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Install-FromExe.ps1
Install-FromExe.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Downloads an installs a MSI package. .Description Downloads a...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Get-WebKitSVNUrl.ps1
Get-WebKitSVNUrl.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Retrieves the location of WebKit's SVN repository. #> Function Get-...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Install-Ninja.ps1
Install-Ninja.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Installs the Ninja build system. .Description Downloads the s...
PowerShellCorpus/PowerShellGallery/WebKitDev/0.1.1/Functions/Install-FromArchive.ps1
Install-FromArchive.ps1
# Copyright (c) 2017, the WebKit for Windows project authors. Please see the # AUTHORS file for details. All rights reserved. Use of this source code is # governed by a BSD-style license that can be found in the LICENSE file. <# .Synopsis Downloads an installs a package from an archive format. .Descrip...
PowerShellCorpus/PowerShellGallery/AzureRM.Billing/0.11.0/AzureRmProfileStartup.ps1
AzureRmProfileStartup.ps1
# ---------------------------------------------------------------------------------- # # 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.apach...
PowerShellCorpus/PowerShellGallery/AzureRM.Billing/0.13.0/AzureRmProfileStartup.ps1
AzureRmProfileStartup.ps1
# ---------------------------------------------------------------------------------- # # 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.apach...
PowerShellCorpus/PowerShellGallery/PSMarkdown/1.1/ConvertFrom-Markdown.ps1
ConvertFrom-Markdown.ps1
<# .Synopsis Converts a Markdown table to a PowerShell object. .Description The ConvertFrom-Markdown function converts a Markdown formatted table to a Powershell Object .EXAMPLE Get-Service | Select-Object Name, DisplayName, Status | ConvertTo-Markdown | ConvertFrom-Markdown This command gets t...
PowerShellCorpus/PowerShellGallery/PSMarkdown/1.1/ConvertTo-Markdown.ps1
ConvertTo-Markdown.ps1
<# .Synopsis Converts a PowerShell object to a Markdown table. .Description The ConvertTo-Markdown function converts a Powershell Object to a Markdown formatted table .EXAMPLE Get-Process | Where-Object {$_.mainWindowTitle} | Select-Object ID, Name, Path, Company | ConvertTo-Markdown This command g...
PowerShellCorpus/PowerShellGallery/GoogleCloudBeta/1.0.0.5/AppendPsModulePath.ps1
AppendPsModulePath.ps1
# Copyright 2015-2016 Google Inc. All Rights Reserved. # Licensed under the Apache License Version 2.0. # # Appends the Cloud Tools for PowerShell module location to the registry's PSModulePath environment # variable param($installPath) # Let a user manually select a Cloud SDK install path $installPath = $insta...
PowerShellCorpus/PowerShellGallery/GoogleCloudBeta/1.0.0.5/BootstrapCloudToolsForPowerShell.ps1
BootstrapCloudToolsForPowerShell.ps1
# Copyright 2015 Google Inc. All Rights Reserved. # Licensed under the Apache License Version 2.0. # # Bootstraps the Google Cloud cmdlets into the current PowerShell session. function Get-ScriptDirectory { $invocation = (Get-Variable MyInvocation -Scope 1).Value return Split-Path $invocation.MyCommand...
PowerShellCorpus/PowerShellGallery/GoogleCloudBeta/1.0.0.5/PatchFromGcs.ps1
PatchFromGcs.ps1
# Copyright 2015-2016 Google Inc. All Rights Reserved. # Licensed under the Apache License Version 2.0. # # Updates Cloud Tools for PowerShell module to the latest found in # Google Cloud Storage bucket g-cloudsharp-unsignedbinaries. # Let a user manually select a Cloud SDK install path param($installPath) $i...
PowerShellCorpus/PowerShellGallery/VMware.DeployAutomation/6.5.1.5299608/Initialize-VMware_DeployAutomation.ps1
Initialize-VMware_DeployAutomation.ps1
function global:Get-DeployCommand() { return (get-command -pssnapin VMware.DeployAutomation),(get-command Get-DeployMachineIdentity,Set-DeployMachineIdentity) } # # .SYNOPSIS # Set the value used to logically link an ESXi host in vCenter to a physical machine. # # .DESCRIPTION # The Set-DeployMachineIdent...
PowerShellCorpus/PowerShellGallery/VMware.DeployAutomation/6.5.1.5299608/VMware.DeployAutomation.ps1
VMware.DeployAutomation.ps1
[VMware.VimAutomation.Sdk.Interop.V1.CoreServiceFactory]::CoreService.OnImportModule( "VMware.DeployAutomation", (Split-Path $script:MyInvocation.MyCommand.Path)); #set aliases set-alias Apply-ESXImageProfile Set-ESXImageProfileAssociation -Scope Global function global:Get-AutoDeployCommand([string] $N...
PowerShellCorpus/PowerShellGallery/Crayon/1.0.11.16/init.ps1
init.ps1
$script:startTs = $null
PowerShellCorpus/PowerShellGallery/Crayon/1.0.11.16/functions/log.ps1
log.ps1
#$asm = [Reflection.Assembly]::LoadFile("$PSScriptRoot\..\lib\Crayons.dll") $p = new-object -type Crayons.Patterns.Pattern $p.Add("'(?<magenta>.*?)'", "quoted names") $p.Add("^(?<green>info):", "info log level") $p.Add("^(?<yellow>warn):", "warn log level") $p.Add("^(?<red>err) :", "error log level") $p.Add("^(?<cyan...
PowerShellCorpus/PowerShellGallery/CompleteHipChat/1.0.1/functions/Get-HipChatRooms.ps1
Get-HipChatRooms.ps1
function Get-HipChatRooms { <# .SYNOPSIS Returns an array of HipChat rooms that the auth token has access to. .DESCRIPTION Returns an array of HipChat rooms that the auth token has access to. .LINK https://github.com/DaveStephens/PSHipchat .PARAMETER AuthToken Required. Your HipChat API token, that you c...
PowerShellCorpus/PowerShellGallery/CompleteHipChat/1.0.1/functions/Send-HipChatMessage.ps1
Send-HipChatMessage.ps1
function Send-HipChatMessage { <# .SYNOPSIS Sends a message to a room in HipChat. .DESCRIPTION Sends a message to a room in HipChat. .LINK https://github.com/DaveStephens/PSHipchat .PARAMETER AuthToken Required. Your HipChat API token, created here https://www.hipchat.com/account/api .PARAMETER RoomID ...
PowerShellCorpus/PowerShellGallery/NordTools/1.0.2/public/Install-NordVPN.ps1
Install-NordVPN.ps1
#Requires -RunAsAdministrator #Requires -Modules @{ModuleName="msi";ModuleVersion="3.2.3.1024"} $ErrorActionPreference = "Stop" Import-Module -Name "$(Split-Path $PSScriptRoot -Parent)\Private\Helpers.psm1" -DisableNameChecking function Install-NordVpn { <# .SYNOPSIS Installs NordVPN app .PARAMET...
PowerShellCorpus/PowerShellGallery/NordTools/1.0.2/public/Uninstall-NordVPN.ps1
Uninstall-NordVPN.ps1
#Requires -RunAsAdministrator #Requires -Modules @{ModuleName="msi";ModuleVersion="3.2.3.1024"} $ErrorActionPreference = "Stop" function Uninstall-NordVpn { <# .SYNOPSIS Uninstalls NordVpn app .PARAMETER displayLog Indicates if to display the uninstallation log file .PARAMETER cleanInstallDir ...
PowerShellCorpus/PowerShellGallery/PSPath/1.0.1/Update-Path.ps1
Update-Path.ps1
function Update-Path { $configuredPaths = [string[]] (& { foreach($path in & { (Get-ItemProperty 'HKLM:\System\CurrentControlSet\Control\Session Manager\Environment').Path; (Get-ItemProperty 'HKCU:\Environment').Path; }) { if($path) { $pat...
PowerShellCorpus/PowerShellGallery/WebAdministrationDsc/0.1.0.0/Examples/Sample_SSLSettings_RequireCert.ps1
Sample_SSLSettings_RequireCert.ps1
configuration Sample_SSLSetting_RequireCert { param ( # Target nodes to apply the configuration [String[]]$NodeName = 'localhost' ) # Import the module that defines custom resources Import-DscResource -Module xWebAdministration Node $NodeName { SSLSett...
PowerShellCorpus/PowerShellGallery/WebAdministrationDsc/0.1.0.0/Examples/Sample_IisLogging_Truncate.ps1
Sample_IisLogging_Truncate.ps1
configuration Sample_IisLogging_Truncate { param ( # Target nodes to apply the configuration [String[]]$NodeName = 'localhost' ) # Import the module that defines custom resources Import-DscResource -Module xWebAdministration Node $NodeName { IisLogging ...
PowerShellCorpus/PowerShellGallery/WebAdministrationDsc/0.1.0.0/Examples/Sample_Website_WithSSLFlags.ps1
Sample_Website_WithSSLFlags.ps1
configuration Sample_Website_NewWebsite { param ( # Target nodes to apply the configuration [String[]]$NodeName = 'localhost', # Name of the website to create [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [String]$WebSiteName, # Source Pa...
PowerShellCorpus/PowerShellGallery/WebAdministrationDsc/0.1.0.0/Examples/Sample_Website_RemoveDefault.ps1
Sample_Website_RemoveDefault.ps1
configuration Sample_Website_StopDefault { param ( # Target nodes to apply the configuration [String[]]$NodeName = 'localhost' ) # Import the module that defines custom resources Import-DscResource -Module xWebAdministration, PSDesiredStateConfiguration Node $NodeNam...
PowerShellCorpus/PowerShellGallery/WebAdministrationDsc/0.1.0.0/Examples/Sample_Website_NewWebsiteFromConfigurationData.ps1
Sample_Website_NewWebsiteFromConfigurationData.ps1
Configuration Sample_Website_FromConfigurationData { # Import the module that defines custom resources Import-DscResource -Module xWebAdministration, PSDesiredStateConfiguration # Dynamically find the applicable nodes from configuration data Node $AllNodes.where{$_.Role -eq 'Web'}.NodeName {...
PowerShellCorpus/PowerShellGallery/WebAdministrationDsc/0.1.0.0/Examples/Sample_IisLogging_Rollover.ps1
Sample_IisLogging_Rollover.ps1
configuration Sample_IisLogging_Rollover { param ( # Target nodes to apply the configuration [String[]]$NodeName = 'localhost' ) # Import the module that defines custom resources Import-DscResource -Module xWebAdministration Node $NodeName { IisLogging ...
PowerShellCorpus/PowerShellGallery/WebAdministrationDsc/0.1.0.0/Examples/Sample_Website_NewWebsite.ps1
Sample_Website_NewWebsite.ps1
configuration Sample_Website_NewWebsite { param ( # Target nodes to apply the configuration [String[]]$NodeName = 'localhost', # Name of the website to create [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [String]$WebSiteName, # Source Pa...
PowerShellCorpus/PowerShellGallery/WebAdministrationDsc/0.1.0.0/Tests/Unit/MSFT_SslSettings.Tests.ps1
MSFT_SslSettings.Tests.ps1
$script:DSCModuleName = 'WebAdministrationDsc' $script:DSCResourceName = 'MSFT_SslSettings' #region HEADER $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Path -Pa...
PowerShellCorpus/PowerShellGallery/WebAdministrationDsc/0.1.0.0/Tests/Unit/MSFT_IisLogging.tests.ps1
MSFT_IisLogging.tests.ps1
$script:DSCModuleName = 'WebAdministrationDsc' $script:DSCResourceName = 'MSFT_IisLogging' # Unit Test Template Version: 1.1.0 $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-...
PowerShellCorpus/PowerShellGallery/WebAdministrationDsc/0.1.0.0/Tests/Unit/MSFT_Website.Tests.ps1
MSFT_Website.Tests.ps1
$script:DSCModuleName = 'WebAdministrationDsc' $script:DSCResourceName = 'MSFT_Website' #region HEADER $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Path -Path (...
PowerShellCorpus/PowerShellGallery/WebAdministrationDsc/0.1.0.0/Tests/Integration/MSFT_SslSettings.config.ps1
MSFT_SslSettings.config.ps1
#requires -Version 4 configuration MSFT_SslSettings_Present { Import-DscResource -ModuleName WebAdministrationDsc Node $AllNodes.NodeName { SslSettings Website { Ensure = 'Present' Name = $Node.Website Bindings = $Node.Bindings } ...
PowerShellCorpus/PowerShellGallery/WebAdministrationDsc/0.1.0.0/Tests/Integration/MSFT_Website.Integration.Tests.ps1
MSFT_Website.Integration.Tests.ps1
$script:DSCModuleName = 'WebAdministrationDsc' $script:DSCResourceName = 'MSFT_Website' #region HEADER $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` (-not (Test-Path -Path (...
PowerShellCorpus/PowerShellGallery/WebAdministrationDsc/0.1.0.0/Tests/Integration/MSFT_IisLogging.config.ps1
MSFT_IisLogging.config.ps1
configuration MSFT_IisLogging_Rollover { Import-DscResource -ModuleName @{ModuleName='WebAdministrationDsc'; RequiredVersion='0.1.0.0'} IisLogging Logging { LogPath = 'C:\IISLogFiles' Logflags = @('Date','Time','ClientIP','UserName','ServerIP') LoglocalTimeRollover = $true ...
PowerShellCorpus/PowerShellGallery/WebAdministrationDsc/0.1.0.0/Tests/Integration/MSFT_IisLogging.Integration.Tests.ps1
MSFT_IisLogging.Integration.Tests.ps1
$script:DSCModuleName = 'WebAdministrationDsc' $script:DSCResourceName = 'MSFT_IisLogging' #region HEADER # Integration Test Template Version: 1.1.0 $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResource...
PowerShellCorpus/PowerShellGallery/WebAdministrationDsc/0.1.0.0/Tests/Integration/MSFT_Website.config.ps1
MSFT_Website.config.ps1
#requires -Version 4 configuration MSFT_Website_Present_Started { param( [Parameter(Mandatory = $true)] [String]$CertificateThumbprint ) Import-DscResource -ModuleName WebAdministrationDsc Node $AllNodes.NodeName { Website Website { ...
PowerShellCorpus/PowerShellGallery/WebAdministrationDsc/0.1.0.0/Tests/Integration/MSFT_SslSettings.Integration.Tests.ps1
MSFT_SslSettings.Integration.Tests.ps1
$script:DSCModuleName = 'WebAdministrationDsc' $script:DSCResourceName = 'MSFT_SSLSettings' #region HEADER # Integration Test Template Version: 1.1.0 $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResou...
PowerShellCorpus/PowerShellGallery/DbWebApi-Client/1.1.1.0/Invoke-DbWebApi.Sample.ps1
Invoke-DbWebApi.Sample.ps1
# Invoke-DbWebApi.Sample.ps1 - DbWebApi Client PowerShell Utility # https://github.com/DataBooster/DbWebApi # Date: 2015-06-09 Import-Module "Microsoft.PowerShell.Utility" -Cmdlet "Invoke-RestMethod" Import-Module "$PSScriptRoot\DbWebApi-Client.psd1" -Force Invoke-DbWebApi @args Exit $error.Count;
PowerShellCorpus/PowerShellGallery/DbWebApi-Client/1.1.1.0/Invoke-DbWebApi.Help.ps1
Invoke-DbWebApi.Help.ps1
# Invoke-DbWebApi.Help.ps1 - DbWebApi Client PowerShell Utility # https://github.com/DataBooster/DbWebApi # Date: 2016-03-03 Import-Module "Microsoft.PowerShell.Utility" -Cmdlet "Invoke-RestMethod" Import-Module "$PSScriptRoot\DbWebApi-Client.psd1" -Force Get-Help Invoke-DbWebApi @args
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Generate Module Manifest.ps1
Generate Module Manifest.ps1
$version = "0.13.0" $manifestPath = Join-Path (Split-Path -Parent $MyInvocation.MyCommand.Path) -ChildPath "\PoShMon.psd1" Remove-Item -Path $manifestPath -ErrorAction SilentlyContinue $description = "PoShMon is an open source PowerShell-based server and farm monitoring solution. It's an 'agent-less' monitoring ...
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Samples/SPMonitoring_Critical.ps1
SPMonitoring_Critical.ps1
Import-Module "C:\Dev\GitHub\PoShMon\src\0.4.0\PoShMon.psd1" -Verbose -Force #This is only necessary if you haven't installed the module into your Modules folder, e.g. via PowerShellGallery / Install-Module #Alternatively, use the lines below #If (!(Get-module PoShMon)) # { Import-Module PoShMon } $VerbosePr...
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Samples/SPMonitoring_Daily.ps1
SPMonitoring_Daily.ps1
Import-Module "C:\Dev\GitHub\PoShMon\src\0.4.0\PoShMon.psd1" -Verbose -Force #This is only necessary if you haven't installed the module into your Modules folder, e.g. via PowerShellGallery / Install-Module #Alternatively, use the lines below #If (!(Get-module PoShMon)) # { Import-Module PoShMon } $VerbosePr...
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Configuration/OperatingSystem.ps1
OperatingSystem.ps1
Function OperatingSystem { [CmdletBinding(DefaultParameterSetName="All")] param( [string[]]$EventLogCodes = 'Critical', [hashtable]$EventIDIgnoreList = @{}, [double]$CPULoadThresholdPercent = 90, [double]$FreeMemoryThresholdPercent = 10, [Parameter(ParameterSetNam...
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Configuration/Email.ps1
Email.ps1
Function Email { [CmdletBinding()] param( [parameter(Mandatory)] [string[]]$ToAddress, [parameter(Mandatory)] [string]$FromAddress, [parameter(Mandatory)] [string]$SmtpServer, [int]$Port = 25, [bool]$UseSSL = $false ) return ...
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Configuration/New-PoShMonConfiguration.ps1
New-PoShMonConfiguration.ps1
Function New-PoShMonConfiguration { [CmdletBinding()] param( [parameter(Mandatory, Position = 0)] [scriptblock]$bodyScript ) $Script:PoShMon = @{} $Script:PoShMon.ConfigurationItems = @{} $newConfiguration = @{ TypeName = 'PoShMon.Configuration' ...
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Configuration/SharePoint.ps1
SharePoint.ps1
Function SharePoint { [CmdletBinding()] param( [string]$CentralAdminUrl = '' ) if ($Script:PoShMon.ConfigurationItems.SharePoint -eq $null) { $Script:PoShMon.ConfigurationItems.SharePoint = @{} } else { throw "SharePoint configuration group already created." }...
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Configuration/General.ps1
General.ps1
Function General { [CmdletBinding()] param( [string]$EnvironmentName = $env:COMPUTERNAME, [int]$MinutesToScanHistory = 15, [string[]]$TestsToSkip = @(), [parameter(ParameterSetName="PrimaryServer",HelpMessage="For monitoring a 'farm'' product, like SharePoint, specify a se...
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Configuration/Notitications.ps1
Notitications.ps1
Function Notifications { [CmdletBinding()] param( [parameter(Mandatory)] [scriptblock]$bodyScript, [ValidateSet("All", "OnlyOnFailure", "None")] [string]$When = "All" ) if ($Script:PoShMon.ConfigurationItems.Notifications -eq $null) { $Script:PoShMon...
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Configuration/WebSite.ps1
WebSite.ps1
Function WebSite { [CmdletBinding()] param( [hashtable]$WebsiteDetails = @{} ) if ($Script:PoShMon.ConfigurationItems.WebSite -eq $null) { $Script:PoShMon.ConfigurationItems.WebSite = @{} } else { throw "WebSite configuration group already created." } r...
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Configuration/O365Teams.ps1
O365Teams.ps1
Function O365Teams { [CmdletBinding()] param( [parameter(Mandatory)] [string]$TeamsWebHookUrl ) return @{ TypeName = 'PoShMon.ConfigurationItems.Notifications.O365Teams' TeamsWebHookUrl = $TeamsWebHookUrl } }
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Configuration/Pushbullet.ps1
Pushbullet.ps1
Function Pushbullet { [CmdletBinding()] param( [parameter(Mandatory)] [string]$AccessToken, [parameter(Mandatory)] [string]$DeviceId = $null ) return @{ TypeName = 'PoShMon.ConfigurationItems.Notifications.Pushbullet' AccessToken = $AccessToke...
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Monitoring.OfficeOnlineServer/Invoke-OOSMonitoring.ps1
Invoke-OOSMonitoring.ps1
Function Invoke-OOSMonitoring { [CmdletBinding()] Param( [parameter(Mandatory=$true, HelpMessage="A PoShMonConfiguration instance - use New-PoShMonConfiguration to create it")] [hashtable]$PoShMonConfiguration ) $outputValues = Invoke-MonitoringCore ` -P...
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Monitoring.OfficeOnlineServer/Get-OOSTests.ps1
Get-OOSTests.ps1
Function Get-OOSTests { [CmdletBinding()] Param( ) $tests = [string[]]@( "EventLogs", "CPULoad", "Memory", "DriveSpace", "ComputerTime", "OOSWindowsServiceState" "WebSites" ) return $tests }
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Monitoring.OfficeOnlineServer/Get-ServersInOOSFarm.ps1
Get-ServersInOOSFarm.ps1
Function Get-ServersInOOSFarm { [CmdletBinding()] Param( [hashtable]$PoShMonConfiguration ) #try #{ $remoteSession = Connect-PrimaryServer -PoShMonConfiguration $PoShMonConfiguration # Auto-Discover Servers $serverNames = Invoke-Comma...
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Monitoring.OfficeOnlineServer/Test-OOSWindowsServiceState.ps1
Test-OOSWindowsServiceState.ps1
Function Test-OOSWindowsServiceState { [CmdletBinding()] param ( [hashtable]$PoShMonConfiguration ) $mainOutput = Get-InitialOutputWithTimer -SectionHeader "Windows Service State" -OutputHeaders ([ordered]@{ 'DisplayName' = 'Display Name'; 'Name' = 'Name'; 'Status' = 'Status' }) $...
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Monitoring.OfficeOnlineServer/Get-OOSTestNames.ps1
Get-OOSTestNames.ps1
Function Get-OOSTestNames { [CmdletBinding()] Param( ) $tests = Get-OOSTests return "'" + [system.String]::Join("','", $tests) + "'" #formatted easily for use in TestsToSkip }
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Notifications.O365Teams/New-O365TeamsExceptionSubject.ps1
New-O365TeamsExceptionSubject.ps1
Function New-O365TeamsExceptionSubject { [CmdletBinding()] Param( [hashtable]$PoShMonConfiguration, [ValidateSet("Monitoring", "Repairing")] [string]$Action = "Monitoring" ) return "[PoshMon $($PoShMonConfiguration.General.EnvironmentName) $Action]`r`n" }
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Notifications.O365Teams/New-O365TeamsRepairMessageSubject.ps1
New-O365TeamsRepairMessageSubject.ps1
Function New-O365TeamsRepairMessageSubject { [CmdletBinding()] Param( [hashtable]$PoShMonConfiguration, [object[]]$RepairOutputValues ) return "[PoShMon $($PoShMonConfiguration.General.EnvironmentName) Repair Results]`r`n" }
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Notifications.O365Teams/Send-O365TeamsMessage.ps1
Send-O365TeamsMessage.ps1
Function Send-O365TeamsMessage { [CmdletBinding()] Param( [hashtable]$PoShMonConfiguration, [hashtable]$O365TeamsNotificationSink, [string]$Subject, [string]$Body, [bool]$Critical ) $combinedMessageBody = $subject + $body #$headers = @{"acce...
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Notifications.O365Teams/New-O365TeamsExceptionBody.ps1
New-O365TeamsExceptionBody.ps1
Function New-O365TeamsExceptionBody { [CmdletBinding()] Param( [System.Exception]$Exception, [string]$Action = "monitor" ) $messageBody += "An exception occurred while trying to $Action the environment.`r`n" $messageBody += "Details: $($Exception.ToString())" }
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Notifications.O365Teams/New-O365TeamsRepairMessageBody.ps1
New-O365TeamsRepairMessageBody.ps1
Function New-O365TeamsRepairMessageBody { [CmdletBinding()] Param( [hashtable]$PoShMonConfiguration, [object[]]$RepairOutputValues ) $messageBody = '' foreach ($repairOutputValue in $RepairOutputValues) { $messageBody += "$($repairOutputValue.SectionHeader) ...
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Notifications.O365Teams/New-O365TeamsMessageBody.ps1
New-O365TeamsMessageBody.ps1
Function New-O365TeamsMessageBody { [CmdletBinding()] Param( [hashtable]$PoShMonConfiguration, [ValidateSet("All","OnlyOnFailure","None")][string]$SendNotificationsWhen, [System.Collections.ArrayList]$TestOutputValues, [TimeSpan]$TotalElapsedTime ) $messageBody...
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Notifications.O365Teams/New-O365TeamsMessageSubject.ps1
New-O365TeamsMessageSubject.ps1
Function New-O365TeamsMessageSubject { [CmdletBinding()] Param( [hashtable]$PoShMonConfiguration, [System.Collections.ArrayList]$TestOutputValues ) return "[$($PoShMonConfiguration.General.EnvironmentName) Monitoring Report]`r`n" }
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Notifications.Pushbullet/New-PushbulletMessageSubject.ps1
New-PushbulletMessageSubject.ps1
Function New-PushbulletMessageSubject { [CmdletBinding()] Param( [hashtable]$PoShMonConfiguration, [System.Collections.ArrayList]$TestOutputValues ) $issueCount = 0 foreach ($outputValue in $TestOutputValues) { if (($outputValue.NoIssuesFound -eq $false)) ...
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Notifications.Pushbullet/New-PushbulletExceptionBody.ps1
New-PushbulletExceptionBody.ps1
Function New-PushbulletExceptionBody { [CmdletBinding()] Param( [System.Exception]$Exception, [string]$Action = "monitor" ) $messageBody = '' $messageBody += "An exception occurred while trying to $Action the environment.`r`n" $messageBody += "Details: $($Exception.ToS...
PowerShellCorpus/PowerShellGallery/PoShMon/0.13.0/Functions/PoShMon.Notifications.Pushbullet/New-PushbulletRepairMessageBody.ps1
New-PushbulletRepairMessageBody.ps1
Function New-PushbulletRepairMessageBody { [CmdletBinding()] Param( [hashtable]$PoShMonConfiguration, [object[]]$RepairOutputValues ) $messageBody = '' foreach ($repairOutputValue in $RepairOutputValues) { $messageBody += "$($repairOutputValue.SectionHeader)...