full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/PowerShellGallery/Statistics/1.1.63/Measure-Group.ps1
Measure-Group.ps1
function Measure-Group { [CmdletBinding()] param( [Parameter(Mandatory,ValueFromPipeline)] [ValidateNotNullOrEmpty()] [Microsoft.PowerShell.Commands.GroupInfo[]] $InputObject , [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string] $Pro...
PowerShellCorpus/PowerShellGallery/Statistics/1.1.63/Get-SlidingAverage.ps1
Get-SlidingAverage.ps1
function Get-SlidingAverage { [CmdletBinding()] Param( [Parameter(Mandatory,ValueFromPipeline)] [ValidateNotNullOrEmpty()] [array] $InputObject , [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string] $Property , [Parame...
PowerShellCorpus/PowerShellGallery/Statistics/1.1.63/New-RangeString.ps1
New-RangeString.ps1
function New-RangeString { [CmdletBinding()] param( [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [int] $Width , [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [int] $LeftIndex , [Parameter(Mandatory)] [Valida...
PowerShellCorpus/PowerShellGallery/Statistics/1.1.63/Add-Bar.ps1
Add-Bar.ps1
function Add-Bar { [CmdletBinding()] Param( [Parameter(Mandatory, ValueFromPipeline)] [ValidateNotNullOrEmpty()] [array] $InputObject , [Parameter()] [ValidateNotNullOrEmpty()] [string] $Property = 'Count' , [Parameter()] ...
PowerShellCorpus/PowerShellGallery/Statistics/1.1.63/ConvertFrom-PerformanceCounter.ps1
ConvertFrom-PerformanceCounter.ps1
function ConvertFrom-PerformanceCounter { [CmdletBinding()] param( [Parameter(Mandatory,ValueFromPipeline)] [ValidateNotNullOrEmpty()] [array] $InputObject , [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string] $Instance ) Pr...
PowerShellCorpus/PowerShellGallery/Statistics/1.1.63/Get-WeightedValue.ps1
Get-WeightedValue.ps1
function Get-WeightedValue { [CmdletBinding()] Param( [Parameter(Mandatory,ValueFromPipeline)] [ValidateNotNullOrEmpty()] [array] $InputObject , [Parameter(Mandatory)] [ValidateNotNullOrEmpty()] [string] $Property , [Paramet...
PowerShellCorpus/PowerShellGallery/Statistics/1.1.63/Expand-DateTime.ps1
Expand-DateTime.ps1
function Expand-DateTime { [CmdletBinding()] Param( [Parameter(Mandatory,ValueFromPipeline)] [ValidateNotNullOrEmpty()] [array] $InputObject , [Parameter()] [ValidateNotNullOrEmpty()] [string] $Property = 'Timestamp' ) Process { ...
PowerShellCorpus/PowerShellGallery/cIBMInstallationManager/1.0.7/Examples/Install-IIM.ps1
Install-IIM.ps1
#requires -Version 5 Configuration IIM { Import-DSCResource -module cIBMInstallationManager -ModuleVersion '1.0.6' Package SevenZip { Ensure = 'Present' Name = '7-Zip 9.20 (x64 edition)' ProductId = '23170F69-40C1-2702-0920-000001000000' Path = 'C:\Media\7z920-x64.msi' ...
PowerShellCorpus/PowerShellGallery/cIBMInstallationManager/1.0.7/Classes/IBMProductMedia.ps1
IBMProductMedia.ps1
<# PowerShell Classes to Model IBM Installation Media Key features: - Model product configuration that can be extracted as Clixml files for later use - Expand IBM media from local or network shares - Get estimated size of the product installation - Get list of repository locations once media has ...
PowerShellCorpus/PowerShellGallery/cIBMInstallationManager/1.1.0/IBMIM/Private/Get-IBMInstallationManagerRegistryPath.ps1
Get-IBMInstallationManagerRegistryPath.ps1
# Global Variables / Resource Configuration $IIM_PATH = "HKLM:\Software\IBM\Installation Manager" $IIM_PATH_64 = "HKLM:\Software\Wow6432Node\IBM\Installation Manager" $IIM_PATH_USER = "HKCU:\Software\IBM\Installation Manager" $IIM_PATH_USER_64 = "HKCU:\Software\Wow6432Node\IBM\Installation Manager" #############...
PowerShellCorpus/PowerShellGallery/cIBMInstallationManager/1.1.0/IBMIM/Private/Invoke-IBMInstallationManagerCmdLine.ps1
Invoke-IBMInstallationManagerCmdLine.ps1
############################################################################################################## # Invoke-IBMInstallationManagerCmdLine # Invokes the IBM InstallationManager Command Line (imcl) - accepts licenses automatically ##########################################################################...
PowerShellCorpus/PowerShellGallery/cIBMInstallationManager/1.1.0/IBMIM/Public/Get-IBMInstallationManagerVersion.ps1
Get-IBMInstallationManagerVersion.ps1
############################################################################################################## # Get-IBMInstallationManagerVersion # Returns the version of IIM if installed ############################################################################################################## Function Get-I...
PowerShellCorpus/PowerShellGallery/cIBMInstallationManager/1.1.0/IBMIM/Public/Update-IBMInstallationManager.ps1
Update-IBMInstallationManager.ps1
############################################################################################################## # Update-IBMInstallationManager # Updates IBM Installation Mananger to a newer version ############################################################################################################## Funct...
PowerShellCorpus/PowerShellGallery/cIBMInstallationManager/1.1.0/IBMIM/Public/Install-IBMProductViaCmdLine.ps1
Install-IBMProductViaCmdLine.ps1
############################################################################################################## # Install-IBMProductViaCmdLine # Extracts product media, installs the product via cmdline, and finally performs some clean up ##############################################################################...
PowerShellCorpus/PowerShellGallery/cIBMInstallationManager/1.1.0/IBMIM/Public/Install-IBMProduct.ps1
Install-IBMProduct.ps1
############################################################################################################## # Install-IBMProduct # Extracts product media, generates response file, installs the product, and finally performs some clean up ###########################################################################...
PowerShellCorpus/PowerShellGallery/cIBMInstallationManager/1.1.0/IBMIM/Public/Get-IBMInstallationManagerHome.ps1
Get-IBMInstallationManagerHome.ps1
############################################################################################################## # Get-IBMInstallationManagerHome # Returns the location where IBM Installation Manager is installed ########################################################################################################...
PowerShellCorpus/PowerShellGallery/cIBMInstallationManager/1.1.0/IBMIM/Public/New-IBMInstallationManagerResponseFile.ps1
New-IBMInstallationManagerResponseFile.ps1
############################################################################################################## # New-IBMInstallationManagerResponseFile # Generates a new response file based on the template specified. # - Updates the repository locations from the ProductMedia parameter along with the extracted...
PowerShellCorpus/PowerShellGallery/cIBMInstallationManager/1.1.0/IBMIM/Public/Install-IBMInstallationManager.ps1
Install-IBMInstallationManager.ps1
############################################################################################################## # Install-IBMInstallationManager # Installs IBM Installation Mananger ############################################################################################################## Function Install-IBMIn...
PowerShellCorpus/PowerShellGallery/cIBMInstallationManager/1.1.0/IBMIM/Public/Install-IBMProductViaResponseFile.ps1
Install-IBMProductViaResponseFile.ps1
############################################################################################################## # Install-IBMProductViaResponseFile # Installs and IBM Product based on the response file specified ########################################################################################################...
PowerShellCorpus/PowerShellGallery/cIBMInstallationManager/1.1.0/IBMIM/Public/Get-IBMInstallationManagerTempDir.ps1
Get-IBMInstallationManagerTempDir.ps1
############################################################################################################## # Get-IBMInstallationManagerTempDir # Retrieves the temporary directory that IBM Installation Manager uses for installing products #########################################################################...
PowerShellCorpus/PowerShellGallery/cIBMInstallationManager/1.1.0/IBMIM/Public/ConvertTo-HashedPassword.ps1
ConvertTo-HashedPassword.ps1
############################################################################################################## # ConvertTo-HashedPassword # Generates a hashed password from password specified using the IBM Installation Manager Command Line ###########################################################################...
PowerShellCorpus/PowerShellGallery/cIBMInstallationManager/1.1.0/IBMIM/Public/Set-IBMInstallationManagerTempDir.ps1
Set-IBMInstallationManagerTempDir.ps1
############################################################################################################## # Set-IBMInstallationManagerTempDir # Updates the temporary directory that IBM Installation Manager ########################################################################################################...
PowerShellCorpus/PowerShellGallery/cIBMInstallationManager/1.1.0/IBMIM/Public/Get-IBMTempDir.ps1
Get-IBMTempDir.ps1
############################################################################################################## # Get-IBMTempDir # Retrieves the current temporary directory used for IBM. Fallsback to the environment temp directory ####################################################################################...
PowerShellCorpus/PowerShellGallery/cIBMInstallationManager/1.1.0/Examples/cIBMInstallationManagerInstall_Example.ps1
cIBMInstallationManagerInstall_Example.ps1
#requires -Version 5 Configuration IIM { Import-DSCResource -module cIBMInstallationManager Package SevenZip { Ensure = 'Present' Name = '7-Zip 9.20 (x64 edition)' ProductId = '23170F69-40C1-2702-0920-000001000000' Path = 'C:\Media\7z920-x64.msi' } cIBMInsta...
PowerShellCorpus/PowerShellGallery/MrACredential/1.0/Import-Credential.ps1
Import-Credential.ps1
<# .Synopsis Import credential object from disk. .DESCRIPTION Import credential object from disk to be used with automation. .NOTES Created by: Jason Wasser @wasserja Modified: 4/20/2017 11:41:26 AM .EXAMPLE PS C:\> $Credential = Import-Credential .EXAMPLE PS C:\> $Credential = Import-Credential -Cred...
PowerShellCorpus/PowerShellGallery/MrACredential/1.0/New-EncryptionKey.ps1
New-EncryptionKey.ps1
<# .Synopsis Generate a new random encryption key. .DESCRIPTION Generate a new random encryption key to be used with encrypting/decrypting stored credential files. .NOTES Created by: Jason Wasser Modified: 4/20/2017 11:34:25 AM .EXAMPLE PS C:\> New-EncryptionKey 217 154 250 143 74 79 214 255...
PowerShellCorpus/PowerShellGallery/MrACredential/1.0/Save-Credential.ps1
Save-Credential.ps1
<# .Synopsis Store credential object to disk. .DESCRIPTION Store credential object to disk to be used with automation. .NOTES Created by: Jason Wasser @wasserja Modified: 4/20/2017 11:39:09 AM .EXAMPLE PS C:\> Save-Credential .EXAMPLE PS C:\> Save-Credential -Username jsmith -EncryptionKeyPath c:\Keys...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Private/PSAppVeyor.Classes.ps1
PSAppVeyor.Classes.ps1
# https://www.appveyor.com/docs/api/ #region Classes Class AppVeyorProject { [Int]$ProjectId [Int]$AccountId [String]$AccountName [AppVeyorBuild[]]$Builds [String]$Name [String]$Slug [AppVeyorProjectRepositoryType]$RepositoryType [String]$RepositoryScm [String]$RepositoryName [...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Private/Invoke-AppVeyorApi.ps1
Invoke-AppVeyorApi.ps1
Function Invoke-AppVeyorApi { [CmdletBinding( ConfirmImpact = "Low", SupportsShouldProcess = $true )] [OutputType()] Param ( [Parameter( Mandatory = $false )] [HashTable] $Headers = @{}, [Parameter( Mandatory = $...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/Get-AppVeyorBuild.ps1
Get-AppVeyorBuild.ps1
Function Get-AppVeyorBuild { [CmdletBinding( DefaultParameterSetName = '__AllParameterSets' )] [OutputType( [AppVeyorBuild] )] Param ( [Parameter( Mandatory = $true, ValueFromPipelineByPropertyName = $true )] [String] $Acc...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/Remove-AppVeyorEnvironment.ps1
Remove-AppVeyorEnvironment.ps1
Function Remove-AppVeyorEnvironment { [CmdletBinding( ConfirmImpact = 'High', SupportsShouldProcess = $true )] [OutputType()] Param ( [Parameter( Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true )]...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/Get-AppVeyorCollaborator.ps1
Get-AppVeyorCollaborator.ps1
Function Get-AppVeyorCollaborator { [CmdletBinding()] [OutputType( [AppVeyorUser] )] Param ( [Parameter( ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true )] [Int[]] $UserId ) Process { if ($null -ne $Use...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/Remove-AppVeyorCollaborator.ps1
Remove-AppVeyorCollaborator.ps1
Function Remove-AppVeyorCollaborator { [CmdletBinding( ConfirmImpact = 'High', SupportsShouldProcess = $true )] [OutputType()] Param ( [Parameter( Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true )...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/New-AppVeyorProject.ps1
New-AppVeyorProject.ps1
Function New-AppVeyorProject { [CmdletBinding( ConfirmImpact = 'Medium', SupportsShouldProcess = $true )] [OutputType( [AppVeyorProject] )] Param ( [Parameter( Mandatory = $true, ValueFromPipelineByPropertyName = $true )] [Str...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/Get-AppVeyorEnvironment.ps1
Get-AppVeyorEnvironment.ps1
Function Get-AppVeyorEnvironment { [CmdletBinding()] [OutputType( [AppVeyorEnvironment] )] Param ( [Parameter( ValueFromPipelineByPropertyName = $true )] [Int] $DeploymentEnvironmentID = $null ) Process { $restMethod = "environments"...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/Update-AppVeyorProjectBuildNumber.ps1
Update-AppVeyorProjectBuildNumber.ps1
Function Update-AppVeyorProjectBuildNumber { [CmdletBinding( ConfirmImpact = 'Medium', SupportsShouldProcess = $true )] [OutputType( [Void] )] Param ( [Parameter( Mandatory = $true, ValueFromPipelineByPropertyName = $true )] [...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/New-AppVeyorUser.ps1
New-AppVeyorUser.ps1
Function New-AppVeyorUser { [CmdletBinding( ConfirmImpact = 'Medium', SupportsShouldProcess = $true )] [OutputType()] Param ( [Parameter( Mandatory = $true, ValueFromPipelineByPropertyName = $true )] [String] $FullName, [...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/Update-AppVeyorUser.ps1
Update-AppVeyorUser.ps1
Function Update-AppVeyorUser { [CmdletBinding( ConfirmImpact = 'Medium', SupportsShouldProcess = $true )] [OutputType( [Void] )] Param ( [Parameter( Mandatory = $true, ValueFromPipelineByPropertyName = $true )] [Int] $...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/New-AppVeyorCollaborator.ps1
New-AppVeyorCollaborator.ps1
Function New-AppVeyorCollaborator { [CmdletBinding( ConfirmImpact = 'Medium', SupportsShouldProcess = $true )] [OutputType()] Param ( [Parameter( Mandatory = $true, ValueFromPipelineByPropertyName = $true )] [String] $Email, ...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/Get-AppVeyorUserRole.ps1
Get-AppVeyorUserRole.ps1
Function Get-AppVeyorUserRole { [CmdletBinding( DefaultParameterSetName = '__AllParameterSets' )] [OutputType( [AppVeyorUserRole] )] Param ( [Parameter( HelpMessage = 'Also retreives the groups associated to each role.', ParameterSetName = 'IncludeGr...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/Update-AppVeyorEnvironment.ps1
Update-AppVeyorEnvironment.ps1
Function Update-AppVeyorEnvironment { [CmdletBinding( ConfirmImpact = 'Medium', SupportsShouldProcess = $true )] [OutputType()] Param ( ) Process { if ($PSCmdlet.ShouldProcess()) { } } }
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/Remove-AppVeyorUser.ps1
Remove-AppVeyorUser.ps1
Function Remove-AppVeyorUser { [CmdletBinding( ConfirmImpact = 'High', SupportsShouldProcess = $true )] [OutputType()] Param ( [Parameter( Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true )] ...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/Remove-AppVeyorProject.ps1
Remove-AppVeyorProject.ps1
Function Remove-AppVeyorProject { [CmdletBinding( ConfirmImpact = 'High', SupportsShouldProcess = $true )] [OutputType( [Void] )] Param ( [Parameter( Mandatory = $true, ValueFromPipelineByPropertyName = $true )] [String] ...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/Get-AppVeyorProject.ps1
Get-AppVeyorProject.ps1
Function Get-AppVeyorProject { [CmdletBinding()] [OutputType( [AppVeyorProject] )] Param ( [Parameter( Mandatory = $true, ValueFromPipelineByPropertyName = $true )] [String] $AccountName, [Parameter( Mandatory = $...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/Set-AppVeyorApiToken.ps1
Set-AppVeyorApiToken.ps1
Function Set-AppVeyorApiToken { [CmdletBinding( ConfirmImpact = 'High', SupportsShouldProcess = $true )] [OutputType( [Void] )] Param ( [Parameter( HelpMessage = 'The value of a token from https://ci.appveyor.com/api-token.', Mandatory = ...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/Get-AppVeyorProjectSetting.ps1
Get-AppVeyorProjectSetting.ps1
Function Get-AppVeyorProjectSetting { [CmdletBinding()] [OutputType( [AppVeyorProjectSetting] )] Param ( [Parameter( Mandatory = $true, ValueFromPipelineByPropertyName = $true )] [String] $AccountName, [Parameter( ...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/Stop-AppVeyorProjectBuild.ps1
Stop-AppVeyorProjectBuild.ps1
Function Stop-AppVeyorProjectBuild { [CmdletBinding( ConfirmImpact = 'Medium', SupportsShouldProcess = $true )] [OutputType( [Void] )] Param ( [Parameter( Mandatory = $true, ValueFromPipelineByPropertyName = $true )] [String] ...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/Get-AppVeyorUser.ps1
Get-AppVeyorUser.ps1
Function Get-AppVeyorUser { [CmdletBinding()] [OutputType( [AppVeyorUser] )] Param ( [Parameter( ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true )] [Int[]] $UserId ) Process { if ($null -ne $UserId) { ...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/Start-AppVeyorProjectBuild.ps1
Start-AppVeyorProjectBuild.ps1
Function Start-AppVeyorProjectBuild { [CmdletBinding( SupportsShouldProcess = $true )] [OutputType( [AppVeyorBuild] )] Param ( [Parameter( Mandatory = $true, ValueFromPipelineByPropertyName = $true )] [String] $AccountName, ...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/New-AppVeyorEnvironment.ps1
New-AppVeyorEnvironment.ps1
Function New-AppVeyorEnvironment { [CmdletBinding( ConfirmImpact = 'Medium', SupportsShouldProcess = $true )] [OutputType()] Param ( ) Process { if ($PSCmdlet.ShouldProcess()) { } } }
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/Get-AppVeyorProjectDeployment.ps1
Get-AppVeyorProjectDeployment.ps1
Function Get-AppVeyorProjectDeployment { [CmdletBinding()] [OutputType()] Param ( [Parameter( Mandatory = $true, ValueFromPipelineByPropertyName = $true )] [String] $AccountName, [Parameter( Mandatory = $true, Val...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/Remove-AppVeyorUserRole.ps1
Remove-AppVeyorUserRole.ps1
Function Remove-AppVeyorUserRole { [CmdletBinding( ConfirmImpact = 'High', SupportsShouldProcess = $true )] [OutputType( [Void] )] Param ( [Parameter( Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPropertyNa...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/Update-AppVeyorUserRole.ps1
Update-AppVeyorUserRole.ps1
Function Update-AppVeyorUserRole { [CmdletBinding( ConfirmImpact = 'Medium', SupportsShouldProcess = $true )] [OutputType( [AppVeyorUserRole] )] Param ( [Parameter( Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineBy...
PowerShellCorpus/PowerShellGallery/PSAppVeyor/0.2.11/Public/New-AppVeyorUserRole.ps1
New-AppVeyorUserRole.ps1
Function New-AppVeyorUserRole { [CmdletBinding( ConfirmImpact = 'Medium', SupportsShouldProcess = $true )] [OutputType( [AppVeyorUserRole] )] Param ( [Parameter( Mandatory = $true, ValueFromPipeline = $true, ValueFromPipelineByPro...
PowerShellCorpus/PowerShellGallery/FormatPx/1.1.3.15/scripts/Export-BinaryModule.ps1
Export-BinaryModule.ps1
<############################################################################# FormatPx separates the formatting layer from the data processing layer in PowerShell. By default, PowerShell's native Format-* cmdlets convert data objects into format objects when are then rendered in the console. This reduces the usefu...
PowerShellCorpus/PowerShellGallery/sthTools/0.15/Test-sthWindowsUpdateRebootRequired.ps1
Test-sthWindowsUpdateRebootRequired.ps1
<# .synopsis Function for testing and rebooting computers on reboot pending after update installation .description Function for testing local and remote computers on reboot pending after update installation. Checks Component Based Servicing registry key - HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Compone...
PowerShellCorpus/PowerShellGallery/xDatabase/1.6.0.0/Examples/Sample_xDBPackage.ps1
Sample_xDBPackage.ps1
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingComputerNameHardcoded", "")] Param( ) configuration DbBackup { param ( [PSCredential]$Credentials, [Parameter(M...
PowerShellCorpus/PowerShellGallery/xDatabase/1.6.0.0/Examples/Sample_xDatabase.ps1
Sample_xDatabase.ps1
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingComputerNameHardcoded", "")] Param( ) $assemblylist = "Microsoft.SqlServer.Dac.dll", "Microsoft.SqlServer.Smo.dll" $sqlpsreg11...
PowerShellCorpus/PowerShellGallery/xDatabase/1.6.0.0/Tests/MSFT_xDatabase.Tests.ps1
MSFT_xDatabase.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $leaf = Split-Path -Leaf $MyInvocation.MyCommand.Path $source = "..\DSCResources\$($leaf.Split(".")[0])\$($leaf -replace ".Tests.ps1$",".psm1")" $common = "..\DSCResources\xDatabase_Common\xDatabase_Common.psm1" $testParameter = @{ Ensure = "Present" ...
PowerShellCorpus/PowerShellGallery/Azure.Storage/3.1.0/AzureStorageStartup.ps1
AzureStorageStartup.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/Azure.Storage/2.8.0/AzureStorageStartup.ps1
AzureStorageStartup.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/MeasureTrace/0.41.0/MakePsModuleDirFromBuildDir.ps1
MakePsModuleDirFromBuildDir.ps1
<# Written and shared by Microsoft employee Matthew Reynolds in the spirit of "Small OSS libraries, tool, and sample code" OSS policy MIT license https://github.com/MatthewMWR/MeasureTrace/blob/master/LICENSE #> param($Source = $psscriptroot, $InstallScope = 'CurrentUser', $Filter = '*.psd1') foreach($modul...
PowerShellCorpus/PowerShellGallery/365Admin/1.0.2.1/init.ps1
init.ps1
# use this file to define global variables on module scope # or perform other initialization procedures. # this file will not be touched when new functions are exported to # this module.
PowerShellCorpus/PowerShellGallery/365Admin/1.0.2.1/Start-DirSync.ps1
Start-DirSync.ps1
function Start-DirSync { <# .SYNOPSIS Kicks off AD Connect Sync Cycle .DESCRIPTION Kicks off AD Connect Sync Cycle of specified type on specified server. .EXAMPLE Start-DirSync -SyncType Initial Starts Initial (Full) DirSync on AD Sync Server scrp-nettools01 (Default...
PowerShellCorpus/PowerShellGallery/365Admin/1.0.2.1/Connect-SPOL.ps1
Connect-SPOL.ps1
function Connect-SPOL { <# .SYNOPSIS Connects to SharePoint Online .DESCRIPTION Connects to SharePoint Online REF: https://technet.microsoft.com/library/fp161372%28v=office.15%29.aspx?f=255&MSPPError=-2147217396 REF: https://www.microsoft.com/en-us/download/confirmation.aspx?id=35588 ...
PowerShellCorpus/PowerShellGallery/365Admin/1.0.2.1/Start-ExternalEmailTester.ps1
Start-ExternalEmailTester.ps1
Function Start-ExternalEmailTester { param( [Parameter(Mandatory=$true)] [System.Management.Automation.PsCredential] $Cred = $Host.UI.PromptForCredential('Enter Outlook.com Credential', 'Enter the username and password of your outlook.com account.', '', 'userCreds'), [String] ...
PowerShellCorpus/PowerShellGallery/365Admin/1.0.2.1/Add-SendAsPermission.ps1
Add-SendAsPermission.ps1
function Add-SendAsPermission { <# .SYNOPSIS Adds SendAs Extended Right to target user .EXAMPLE Add-SendAsPermission -enduser steve -targetmailbox bob Adds SendAs permission on bob's mailbox for end user steve. #> param ( [String] [Parameter(Mandatory)] $en...
PowerShellCorpus/PowerShellGallery/365Admin/1.0.2.1/Disconnect-ExchangeOnline.ps1
Disconnect-ExchangeOnline.ps1
Function Disconnect-ExchangeOnline { Get-PSSession | ?{$_.ComputerName -like '*outlook.office365.com'} | Remove-PSSession }
PowerShellCorpus/PowerShellGallery/365Admin/1.0.2.1/Watch-EOLMigrationStatus.ps1
Watch-EOLMigrationStatus.ps1
function Watch-EOLMigrationStatus { <# .SYNOPSIS Connects to Exchange Online and grabs the status of any pending migrations. .DESCRIPTION Connects to Exchange Online and grabs the status of any pending migrations. .EXAMPLE Watch-EOLMigrationStatus -SleepingMinutes 5 Connects to ...
PowerShellCorpus/PowerShellGallery/365Admin/1.0.2.1/Get-DailyEmailCounts.ps1
Get-DailyEmailCounts.ps1
function Get-DailyEmailCounts { <# .SYNOPSIS Gathers a simple report of number/basic info of emails received by a certain Exchange Online address. .DESCRIPTION Connects to Exchange Online and gathers daily email counts for the last day ("Number of emails sent TO this email box from Midnight Yest...
PowerShellCorpus/PowerShellGallery/365Admin/1.0.2.1/Disconnect-ExchangeComplianceOnline.ps1
Disconnect-ExchangeComplianceOnline.ps1
Function Disconnect-ExchangeComplianceOnline { Get-PSSession | ?{$_.ComputerName -like '*ps.compliance.protection.outlook.com'} | Remove-PSSession }
PowerShellCorpus/PowerShellGallery/365Admin/1.0.2.1/Connect-ExchangeComplianceOnline.ps1
Connect-ExchangeComplianceOnline.ps1
Function Connect-ExchangeComplianceOnline { [CmdletBinding()] param ( [Parameter(Mandatory = $False)] [System.Management.Automation.PsCredential]$Credential = $Host.UI.PromptForCredential('Enter Global Admin Credential', 'Enter the username and password of an Exchange Online Global Administr...
PowerShellCorpus/PowerShellGallery/365Admin/1.0.2.1/Confirm-ExchangeOnlineConnection.ps1
Confirm-ExchangeOnlineConnection.ps1
function Confirm-ExchangeOnlineConnection { <# .SYNOPSIS Confirms there is an active connection to Exchange Online. Connects if prompted. .DESCRIPTION Confirms there is an active connection to Exchange Online. Connects if prompted. .EXAMPLE Confirm-ExchangeOnlineConnection -ConnectIfDi...
PowerShellCorpus/PowerShellGallery/365Admin/1.0.2.1/Get-ExchangeOnlineConnectionState.ps1
Get-ExchangeOnlineConnectionState.ps1
Function Get-ExchangeOnlineConnectionState { $ConnectionState = (Get-PSSession | ? {$_.ConfigurationName -eq 'Microsoft.Exchange' -and $_.State -eq 'Opened' -and $_.ComputerName -eq 'ps.outlook.com'}).count if ($ConnectionState -eq 0) { return 'Disconnected' } if ($ConnectionState -eq 1) { return ...
PowerShellCorpus/PowerShellGallery/365Admin/1.0.2.1/Add-FullAccessPermission.ps1
Add-FullAccessPermission.ps1
function Add-FullAccessPermission { <# .SYNOPSIS Adds FullAccess to target user .EXAMPLE Add-FullAccessPermission -enduser steve -targetmailbox bob Adds SendAs permission on bob's mailbox for end user steve WITHOUT AutoMapping. .EXAMPLE Add-FullAccessPermission -...
PowerShellCorpus/PowerShellGallery/365Admin/1.0.2.1/Connect-ExchangeOnline.ps1
Connect-ExchangeOnline.ps1
Function Connect-ExchangeOnline { [CmdletBinding()] param ( [Parameter(Mandatory = $False)] [System.Management.Automation.PsCredential]$Credential = $Host.UI.PromptForCredential('Enter Global Admin Credential', 'Enter the username and password of an Exchange Online Global Administrator accou...
PowerShellCorpus/PowerShellGallery/365Admin/1.0.2.1/Backup-Whitelist.ps1
Backup-Whitelist.ps1
Function Backup-Whitelist { param( [System.Diagnostics.Switch] $Debugging, [Switch] $SendEmail, [Parameter(Mandatory = $False)] [String] $BackupPath = 'C:\scripts\powershell\EOL_WhitelistBackups\', [Parameter(Mandatory = $true)] [String] $EmailRecipient...
PowerShellCorpus/PowerShellGallery/365Admin/1.0.2.1/Get-Wasted365License.ps1
Get-Wasted365License.ps1
function Get-Wasted365License { <# .SYNOPSIS Checks EOL for users with associated licenses who are also disabled in AD .DESCRIPTION This script is meant to find disabled users in Active Directory who are burning a 365 license. .EXAMPLE Get-Wasted365License -ProductType Ente...
PowerShellCorpus/PowerShellGallery/PSForge/1.1.0/UnitTest.ps1
UnitTest.ps1
Import-Module Pester Remove-Module PSForge -ErrorAction SilentlyContinue Import-Module $PSScriptRoot/PSForge.psm1 Invoke-Pester $PSScriptRoot/PSForge.Tests.ps1
PowerShellCorpus/PowerShellGallery/PSForge/1.1.0/MyGet.ps1
MyGet.ps1
param( [string] $packageVersion = $env:PackageVersion, [bool] $fakeBuildRunner = $false ) Invoke-Expression ".\paket restore -f" Import-Module -Force .\PowershellDSCWorkflow.psm1 Import-Module -Force .\packages\Plaster\Plaster.psm1 Export-DSCModule -Version $packageVersion Remove-Item -Recurse .\packages
PowerShellCorpus/PowerShellGallery/PSForge/1.1.0/PSForge.Tests.ps1
PSForge.Tests.ps1
$here = Split-Path -Parent $MyInvocation.MyCommand.Path $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path).Replace(".Tests.", ".") InModuleScope PSForge { # Describe "PSForge" { # It "PSForge is available to be imported when called" { # Get-Module –ListAvailable | where { $_.Name –eq 'PSF...
PowerShellCorpus/PowerShellGallery/PSForge/1.1.0/appveyor.ps1
appveyor.ps1
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted Install-Module Pester -Scope CurrentUser Install-Module Plaster -Scope CurrentUser Import-Module .\PSForge.psm1 $res = Invoke-Pester -Path .\PSForge.Tests.ps1 -OutputFormat NUnitXml -OutputFile TestsResults.xml -PassThru (New-Object 'System.Net.WebClient').Up...
PowerShellCorpus/PowerShellGallery/PSForge/1.1.0/plaster-powershell-dsc-module/test/Default.Tests.ps1
Default.Tests.ps1
describe 'When setting up a webserver' { context 'to start the default website' { it 'verifies IIS is installed' { (Get-WindowsFeature web-server).installed | should be $true } it 'installs a default website' { Get-Website 'Default Web Site' | should not be $null } } }
PowerShellCorpus/PowerShellGallery/PSForge/1.1.0/helper_scripts/fixRubyCertStore.ps1
fixRubyCertStore.ps1
$SSL_DIR = "C:\RUBY_SSL" $CA_FILE = "cacert.pem" $CA_URL = "https://curl.haxx.se/ca/${CA_FILE}" New-Item -Type Directory -Force $SSL_DIR [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.SecurityProtocolType]::Tls12; [Environment]::SetEnvironmentVariable("SSL_CERT_FILE", "${SSL_DIR}\${CA_FILE}", "User...
PowerShellCorpus/PowerShellGallery/Gab/1.0/Gab.Tests.ps1
Gab.Tests.ps1
# # This is a PowerShell Unit Test file. # You need a unit test framework such as Pester to run PowerShell Unit tests. # You can download Pester from http://go.microsoft.com/fwlink/?LinkID=534084 #
PowerShellCorpus/PowerShellGallery/AzureIoT/1.0.0.3/Functions/Get-IotDeviceKey.ps1
Get-IotDeviceKey.ps1
function Get-IoTDeviceKey { <# .SYNOPSIS Get the device key for the device. .DESCRIPTION See the Synopsis. .EXAMPLE Get-IoTDeviceKey -iotConnString "HostName=myiothub.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=HwbPu8ZhK8sdfdsfgdsgdfsfdgM2KvRE=" -device...
PowerShellCorpus/PowerShellGallery/AzureIoT/1.0.0.3/Functions/Register-IoTDevice.ps1
Register-IoTDevice.ps1
function Register-IoTDevice { <# .SYNOPSIS Registers an device to IoT Hub. .DESCRIPTION See the Synopsis. .EXAMPLE Register-IoTDevice -iotConnString "HostName=myiothub.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=HwbPu8ZhK8sdfdsfgdsgdfsfdgM2KvRE=" -devic...
PowerShellCorpus/PowerShellGallery/AzureIoT/1.0.0.3/Functions/Receive-IoTCloudMessage.ps1
Receive-IoTCloudMessage.ps1
function Receive-IoTCloudMessage { <# .SYNOPSIS Receives a message from the cloud to the device. .DESCRIPTION See the Synopsis. .EXAMPLE $message = Receive-IoTCloudMessage -deviceClient $deviceClient $message #> [cmdletbinding()] param( $deviceClient ...
PowerShellCorpus/PowerShellGallery/AzureIoT/1.0.0.3/Functions/Get-IoTDeviceClient.ps1
Get-IoTDeviceClient.ps1
function Get-IoTDeviceClient { <# .SYNOPSIS Create a connection object to interact with IoT Hub. .DESCRIPTION See the Synopsis. .EXAMPLE $deviceClient = Get-IoTDeviceClient -iotHubUri myiothub.azure-devices.net -deviceId SampleDevice -deviceKey klsdjkjfdsfh8weifjkhauwhfre= ...
PowerShellCorpus/PowerShellGallery/AzureIoT/1.0.0.3/Functions/Receive-IoTDeviceMessage.ps1
Receive-IoTDeviceMessage.ps1
function Receive-IoTDeviceMessage { <# .SYNOPSIS Receives a message from the device to cloud. .DESCRIPTION See the Synopsis. .EXAMPLE $message = Receive-IoTDeviceMessage -iotConnString "HostName=myIotHub.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=HwbPu...
PowerShellCorpus/PowerShellGallery/AzureIoT/1.0.0.3/Functions/Get-IoTCloudClient.ps1
Get-IoTCloudClient.ps1
function Get-IoTCloudClient { <# .SYNOPSIS Create a connection object to interact with IoT Hub. .DESCRIPTION See the Synopsis. .EXAMPLE $cloudClient = Get-IoTCloudClient - "HostName=myiothub.azure-devices.net;SharedAccessKeyName=iothubowner;SharedAccessKey=jkgyfjhhuytghji876...
PowerShellCorpus/PowerShellGallery/AzureIoT/1.0.0.3/Functions/Send-IoTDeviceMessage.ps1
Send-IoTDeviceMessage.ps1
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, ...
PowerShellCorpus/PowerShellGallery/AzureIoT/1.0.0.3/Functions/Send-IoTCloudMessage.ps1
Send-IoTCloudMessage.ps1
function Send-IoTCloudMessage { <# .SYNOPSIS Sends a message from the cloud to the Device. .DESCRIPTION See the Synopsis. .EXAMPLE Send-IoTCloudMessage -messageString "Hello world" -cloudClient $cloudClient #> [cmdletbinding()] param( $deviceId, $messageSt...
PowerShellCorpus/PowerShellGallery/hashdata/1.0.0.0/publish.ps1
publish.ps1
[cmdletbinding()] Param( [Parameter(Mandatory)] [string] $APIkey ) $tags = @( "hashtable" , "serialize" , "deserialize" , "pscustomobject" , "import" , "export" , "convert" , "Convertto" , "String" ) Publ...
PowerShellCorpus/PowerShellGallery/hashdata/1.0.0.0/Functions/ConvertTo-HashString.ps1
ConvertTo-HashString.ps1
#Requires -Version 4.0 function ConvertTo-HashString { <# .SYNOPSIS Convert an hashtable or and OrderedDictionary to a string .DESCRIPTION Convert an hashtable or and OrderedDictionary to a string .PARAMETER InputObject The object that is to be converted .EXAMPLE $hashObject = @{ ...
PowerShellCorpus/PowerShellGallery/hashdata/1.0.0.0/Functions/Import-HashData.ps1
Import-HashData.ps1
#Requires -Version 4.0 function Import-HashData { <# .SYNOPSIS Import serialized objects from disk. .DESCRIPTION Import serialized objects from disk. The import will check the content of the file for RestrictedLanguage. Only New-Date function is allowed in the script. Other commands will resu...
PowerShellCorpus/PowerShellGallery/hashdata/1.0.0.0/Functions/Assert-ScriptString.ps1
Assert-ScriptString.ps1
#Requires -Version 4.0 function Assert-ScriptString { <# .SYNOPSIS Validate a scriptblock before execution into current runspace .DESCRIPTION Validate a string before execution into current runspace. The only allowed allowed command/cmdlet is New-Date included in this module. The string is conver...
PowerShellCorpus/PowerShellGallery/hashdata/1.0.0.0/Functions/Export-HashData.ps1
Export-HashData.ps1
#Requires -Version 4.0 function Export-HashData { <# .SYNOPSIS Serialize an object to a file as an HashTable. .DESCRIPTION Serialize an object to a file as an HashTable. The majority of the types of the object is preserved in the output. To handle datetime, the module have a function New-Date that...
PowerShellCorpus/PowerShellGallery/hashdata/1.0.0.0/Functions/New-Date.ps1
New-Date.ps1
#Requires -Version 4.0 function New-Date { [cmdletbinding()] Param ( [Parameter(Position=0)] [int64] $Ticks ) [datetime]$Ticks }
PowerShellCorpus/PowerShellGallery/hashdata/1.0.0.0/Functions/ConvertTo-Hashtable.ps1
ConvertTo-Hashtable.ps1
#Requires -Version 4.0 function ConvertTo-Hashtable { <# .SYNOPSIS Converts a PScustomobject to a hashtable .DESCRIPTION Converts a PScustomobject to a hashtable .PARAMETER InputObject The PSCustomObject you want to convert to a hashtable .EXAMPLE $obj = [PSCustomobject]@{ Name...