full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/CatalogItems/Set-RsDataSourcePassword.ps1
Set-RsDataSourcePassword.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) function Set-RsDataSourcePassword { <# .SYNOPSIS Overwrites the password on a Datasource. .DESCRIPTION Overwrites the password on a Datasource. ...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/CatalogItems/New-RsDataSource.ps1
New-RsDataSource.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) function New-RsDataSource { <# .SYNOPSIS This script creates a new data source on Report Server. .DESCRIPTION This script creates a new data source on Report Serv...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/CatalogItems/New-RsFolder.ps1
New-RsFolder.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) function New-RsFolder { <# .SYNOPSIS This script creates a new folder in the Report Server .DESCRIPTION This script creates a new folder in the Report Server .PA...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/CatalogItems/Out-RsFolderContent.ps1
Out-RsFolderContent.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) function Out-RsFolderContent { <# .SYNOPSIS This downloads catalog items from a folder to disk .DESCRIPTION This downloads catalog items from a folder server to ...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/CatalogItems/Remove-RsCatalogItem.ps1
Remove-RsCatalogItem.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) function Remove-RsCatalogItem { <# .SYNOPSIS This function removes an item from the Report Server Catalog. .DESCRIPTION This function removes an item from the Rep...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/CatalogItems/Get-RsItemReference.ps1
Get-RsItemReference.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) function Get-RsItemReference { <# .SYNOPSIS List all item references associated with a report or a dataset. .DESCRIPTION List all item references associated with...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/CatalogItems/Out-RsCatalogItem.ps1
Out-RsCatalogItem.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) function Out-RsCatalogItem { <# .SYNOPSIS This downloads catalog items from a report server to disk. .DESCRIPTION This downloads catalog items from a report serv...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/CatalogItems/Set-RsDataSourceReference.ps1
Set-RsDataSourceReference.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) function Set-RsDataSourceReference { <# .SYNOPSIS Overrides the reference of a report or dataset to a shared data source. .DESCRIPTION Overrides the reference of...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/CatalogItems/Get-RsFolderContent.ps1
Get-RsFolderContent.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) function Get-RsFolderContent { <# .SYNOPSIS List all catalog items under a given path. .DESCRIPTION List all catalog items under a given path. .P...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/CatalogItems/Write-RsFolderContent.ps1
Write-RsFolderContent.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) function Write-RsFolderContent { <# .SYNOPSIS Uploads all items in a folder on disk to a report server. .DESCRIPTION Uploads all items in a folder on disk to a r...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/Common/Get-FileExtension.ps1
Get-FileExtension.ps1
function Get-FileExtension { param( [Parameter(Mandatory=$True)] [string]$TypeName ) switch ($TypeName) { 'Report' { return '.rdl' } 'DataSource' { return '.rsds' } 'DataSet' { return '.rsd' } default {throw 'Unsupported item type! We only sup...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/Common/Get-ItemType.ps1
Get-ItemType.ps1
function Get-ItemType { param ( [string]$FileExtension ) switch ($FileExtension) { '.rdl' {return 'Report'} '.rsds' {return 'DataSource'} '.rsd' {return 'DataSet'} default {throw 'Currently only .rdl, .rsds and .rsd files are supported'} } }
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/Common/ConnectionObjectRequests.ps1
ConnectionObjectRequests.ps1
function New-RsWebServiceProxyHelper { <# .SYNOPSIS Internal helper function. Facilitates generating WebProxy objects. .DESCRIPTION Internal helper function. Facilitates generating WebProxy objects. It accepts all bound parameters of the call...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/Common/ShouldProcess.ps1
ShouldProcess.ps1
function Get-ShouldProcessTargetWmi { <# .SYNOPSIS Creates the target string for a should process call of Wmi functions. .DESCRIPTION Creates the target string for a should process call of Wmi functions. .PARAMETER BoundParameters The act...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/Common/StringManipulation.ps1
StringManipulation.ps1
function Clear-SubString { [CmdletBinding()] param ( [Parameter(Mandatory = $True)] [string] $string, [Parameter(Mandatory = $True)] [string] $substring, [ValidateSet('front', 'back')] [string] ...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/Admin/Set-RsDatabase.ps1
Set-RsDatabase.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) function Set-RsDatabase { <# .SYNOPSIS This script configures the database settings used by SQL Server Reporting Services. .DESCRIPTION This script configures SQ...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/Admin/Register-RsPowerBI.ps1
Register-RsPowerBI.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) function Register-RsPowerBI { <# .SYNOPSIS This script configures Power BI integration. .DESCRIPTION This script configures Power BI integration by providing det...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/Admin/Restore-RsEncryptionKey.ps1
Restore-RsEncryptionKey.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) function Restore-RSEncryptionKey { <# .SYNOPSIS This script restores the SQL Server Reporting Services encryption key. .DESCRIPTION This script restores encryptio...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/Admin/Set-RsEmailSettings.ps1
Set-RsEmailSettings.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) function Set-RsEmailSettings { <# .SYNOPSIS This script configures the Email Settings for SQL Server Reporting Services. .DESCRIPTION This script configures the E...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/Admin/Backup-RsEncryptionKey.ps1
Backup-RsEncryptionKey.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) function Backup-RsEncryptionKey { <# .SYNOPSIS This script creates a back up of the SQL Server Reporting Services encryption key. .DESCRIPTION This script creates...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Functions/Admin/Set-RsDatabaseCredentials.ps1
Set-RsDatabaseCredentials.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) function Set-RsDatabaseCredentials { <# .SYNOPSIS This script configures the credentials used to connect to the database used by SQL Server Reporting Services. .DESCRIPTION ...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Templates/ScriptTemplate.ps1
ScriptTemplate.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) function DoSomeThingTo-RSCatalogItem { <# .SYNOPSIS A brief description of the DoSomeThingTo-RSCatalogItem function. .DESCRIPTION A detailed description of the DoSomeThi...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Tests/Security/AccessToRs.Tests.ps1
AccessToRs.Tests.ps1
function Get-TestUser() { if (-not $env:RsUser) { throw 'Environment variable RsUser is not defined!' } return $env:RsUser } function Get-RsSystemPolicies() { $rsProxy = New-RsWebServiceProxy return $rsProxy.GetSystemPolicies() } Describe "Grant and Revoke Access To Rs" { $user = Get-T...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Tests/Security/AccessOnCatalogItem.Tests.ps1
AccessOnCatalogItem.Tests.ps1
function Get-TestUser() { if (-not $env:RsUser) { throw 'Environment variable RsUser is not defined!' } return $env:RsUser } function Get-RsCatalogItemPolicies() { param( [Parameter(Mandatory = $True)] [string]$Path ) $inheritsParentProperties = $false $rsProxy = Ne...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Tests/CatalogItems/New-RsFolder.Tests.ps1
New-RsFolder.Tests.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) Describe "New-RsFolder" { Context "Create Folder with minimun parameters"{ $folderName = 'SutFolderMinParameters' + [guid]::NewGuid() New-RsFolder -Path / -FolderName $folderName $folderL...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Tests/CatalogItems/Write-RsFolderContent.Tests.ps1
Write-RsFolderContent.Tests.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) Describe "Write-RsFolderContent" { Context "Write-RsFolderContent with min parameters"{ $folderName = 'SutWriteRsFolderContentMinParameters' + [guid]::NewGuid() New-RsFolder -Path / -FolderName ...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Tests/CatalogItems/Get-RsItemReference.Tests.ps1
Get-RsItemReference.Tests.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) Describe "Get-RsItemReference" { Context "Get-RsItemReference with min parameters"{ $folderName = 'SutWriteRsFolderContentMinParameters' + [guid]::NewGuid() New-RsFolder -Pat...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Tests/CatalogItems/Get-RsFolderContentTests.ps1
Get-RsFolderContentTests.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) Describe "Get-RsFolderContent" { Context "Get folder with ReportServerUri parameter"{ # Create a folder $folderName = 'SutGetFolderReportServerUriParameter' + [guid]::NewGuid() New-RsFold...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Tests/CatalogItems/Out-RsFolderContent.Tests.ps1
Out-RsFolderContent.Tests.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) Describe "Out-RsFolderContent" { Context "Out-RsFolderContent with min parameters"{ $folderName = 'SutOutRsFolderContentMinParameters' + [guid]::NewGuid() New-RsFolder -Path ...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Tests/CatalogItems/Get-RsDataSource.Tests.ps1
Get-RsDataSource.Tests.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) Function Get-ExistingDataExtension { $proxy = New-RsWebServiceProxy return $proxy.ListExtensions("Data")[0].Name } Describe "Get-RsDataSource" { Context "Get RsDataSource with ReportServerUri paramete...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Tests/CatalogItems/New-RsDataSource.Tests.ps1
New-RsDataSource.Tests.ps1
# Copyright (c) 2016 Microsoft Corporation. All Rights Reserved. # Licensed under the MIT License (MIT) Function Create-PSCredential { param( [Parameter(Mandatory = $True)] [string]$UserName, [Parameter(Mandatory = $True)] [string]$Password ) $SecurePa...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Tests/Admin/Set-RsDatabaseCredentials.Tests.ps1
Set-RsDatabaseCredentials.Tests.ps1
function Get-CredentialType() { $wmiObject = New-RsConfigurationSettingObject -SqlServerInstance MSSQLSERVER switch ($wmiObject.DatabaseLogonType) { 0 { return 'Windows' } 1 { return 'SQL' } 2 { return 'ServiceAccount' } default { throw 'Invalid Credential Type!' } } } funct...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Tests/Admin/Set-RsDatabase.Tests.ps1
Set-RsDatabase.Tests.ps1
function Get-DatabaseName() { $wmiObject = New-RsConfigurationSettingObject -SqlServerInstance MSSQLSERVER return $wmiObject.DatabaseName } function Get-CredentialType() { $wmiObject = New-RsConfigurationSettingObject -SqlServerInstance MSSQLSERVER switch ($wmiObject.DatabaseLogonType) { 0 { re...
PowerShellCorpus/PowerShellGallery/ReportingServicesTools/0.0.1.1/Tests/Admin/RsEncryptionKey.Tests.ps1
RsEncryptionKey.Tests.ps1
function New-TestDataSource() { $dataSource = New-Object -TypeName PSObject $dataSourceName = 'SimpleDataSource' + [System.DateTime]::Now.Ticks $dataSource | Add-Member -MemberType NoteProperty -Name Name -Value $dataSourceName $dataSource | Add-Member -MemberType NoteProperty -Name ConnectionString -V...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Resource/Get-ArmResource.ps1
Get-ArmResource.ps1
Function Get-ArmResource { [CmdletBinding()] Param ( [Parameter(Mandatory=$true,ParameterSetName='ByObj',ValueFromPipeline=$true)] [Blue.ResourceGroup]$InputObject, [Parameter(Mandatory=$false,ParameterSetName='ByName')] [String]$ResourceGroupName ) Begin...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/ResourceGroup/Get-ArmResourceGroup.ps1
Get-ArmResourceGroup.ps1
<# .Synopsis Gets one or multiple Resource Groups .DESCRIPTION Gets one or multiple Resource Groups .EXAMPLE Get-ArmResourceGroup .EXAMPLE Get-ArmResourceGroup -Name "MyRG" .EXAMPLE Get-ArmResourceGroup -Location "WestEurope" .INPUTS Blue.ResourceGroup Blue.Resource .OUTPUTS Blue.ResourceGroup ....
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/ResourceGroup/New-ArmResourceGroup.ps1
New-ArmResourceGroup.ps1
Function New-ArmResourceGroup { Param ( [Parameter(Mandatory=$true)] [String]$Name, [Parameter(Mandatory=$true)] [String]$Location, [Parameter(Mandatory=$false)] [hashtable]$Tags ) Begin { if (!(Test-InternalArmConnection)) { Write-Error "Please use Connect-A...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/ResourceGroup/Get-ArmLocation.ps1
Get-ArmLocation.ps1
Function Get-ArmLocation { $Script:AzureServiceLocations }
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/ResourceGroup/Remove-ArmResourceGroup.ps1
Remove-ArmResourceGroup.ps1
Function Remove-ArmResourceGroup { [cmdletBinding(SupportsShouldProcess=$true,ConfirmImpact='High')] Param ( [Parameter(Mandatory=$true,ParameterSetName='ByObj',ValueFromPipeline=$true)] [Blue.ResourceGroup]$InputObject, [Parameter(Mandatory=$true,ParameterSetName='ByName', Positi...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Auth/Test-InternalTokenNotExpired.ps1
Test-InternalTokenNotExpired.ps1
function Test-InternalTokenNotExpired { [cmdletbinding()] param ( [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [ValidateNotNullOrEmpty()] [String] $Token ) #based on functions by Shriram MSFT found on technet: https://gallery.technet.microsoft.com/JW...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Auth/Connect-ArmSubscription.ps1
Connect-ArmSubscription.ps1
Function Connect-ArmSubscription { [CmdletBinding(DefaultParameterSetName='VisibleCredPrompt',SupportsShouldProcess=$true)] [OutputType([PsObject])] Param ( [Parameter(Mandatory=$true,ParameterSetName='ConnectByCredObject')] [System.Management.Automation.PSCredential]$Credential, [Parameter(Mandatory=$False...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Auth/Get-ArmSubscription.ps1
Get-ArmSubscription.ps1
<# .Synopsis Lists information about available subscriptions #> Function Get-ArmSubscription { [CmdletBinding(DefaultParameterSetName='AllSUbs')] Param ( # List only the currently connected subscription [Parameter(Mandatory=$true,ParameterSetName='CurrentSub')] [Switch]$Current, ...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Auth/Test-InternalArmConnection.ps1
Test-InternalArmConnection.ps1
Function Test-InternalArmConnection { if ((!$script:CurrentSubscriptionId) -or (!$script:AuthToken)) { return $false } Else { $AuthSuccess = $false #Test that we can reach the current subscription $Uri = "https://management.azure.com/subscriptions/$($script:CurrentSubscriptionId)" $Result =Get-...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Auth/Get-InternalAcquireToken.ps1
Get-InternalAcquireToken.ps1
Function Get-InternalAcquireToken { [CmdletBinding(DefaultParameterSetName='VisibleCredPrompt')] Param ( [Parameter(Mandatory=$true,ParameterSetName='ConnectByCredObject')] [System.Management.Automation.PSCredential]$Credential, [Parameter(Mandatory=$False,ParameterSetName='ConnectByCredObjec...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Automation/Get-ArmAutomationDscNode.ps1
Get-ArmAutomationDscNode.ps1
function Get-ArmAutomationDscNode { [CmdletBinding(DefaultParameterSetName='List')] param ( [Parameter(Mandatory, ParameterSetName='Named')] [ValidateNotNullOrEmpty()] [string] $Name, [Parameter(Mandatory, ParameterSetName='Id')] [ValidateNotNullOrEmpty()] [strin...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Automation/Get-ArmAutomationAccount.ps1
Get-ArmAutomationAccount.ps1
function Get-ArmAutomationAccount { [CmdletBinding(DefaultParameterSetName='None')] param ( [ValidateNotNullOrEmpty()] [string] $Name, [Parameter(ValueFromPipeline, ParameterSetName='ResourceGroup')] [Blue.ResourceGroup] $ResourceGroup ) begin { #This is the basi...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Automation/Remove-ArmAutomationDscNode.ps1
Remove-ArmAutomationDscNode.ps1
function Remove-ArmAutomationDscNode { [CmdletBinding(SupportsShouldProcess, ConfirmImpact='High')] param ( [Parameter(Mandatory, ValueFromPipeline)] [Blue.AutomationDscNode] $Node, [Switch] $Force ) begin { #This is the basic test we do to ensure we have a valid connect...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Automation/Set-ArmAutomationDscNodeConfiguration.ps1
Set-ArmAutomationDscNodeConfiguration.ps1
function Set-ArmAutomationDscNodeConfiguration { [CmdletBinding()] param ( [Parameter(Mandatory, ValueFromPipeline)] [Blue.AutomationDscNode] $Node, [Parameter(Mandatory)] [String] $ConfigurationName ) begin { #This is the basic test we do to ensure we have a val...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Network/Get-ArmNetworkInterface.ps1
Get-ArmNetworkInterface.ps1
Function Get-ArmNetworkInterface { [CmdletBinding(DefaultParameterSetName='ByNothing')] Param ( [Parameter(Mandatory=$False,ParameterSetName='ByNameAndResourceGroupId',ValueFromPipeline=$false)] [Parameter(Mandatory=$False,ParameterSetName='ByNameAndResourceGroupName',ValueFromPipeline=$false)] ...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Network/Get-ArmSubnet.ps1
Get-ArmSubnet.ps1
Function Get-ArmSubnet { [CmdletBinding(DefaultParameterSetName='ByNameAndVirtualNetworkObject')] Param ( [Parameter(Mandatory=$False,ParameterSetName='ByNameAndVirtualNetworkObject',ValueFromPipeline=$false)] [String]$Name, [Parameter(Mandatory=$True,ParameterSetName='ByNameAnd...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Network/Get-ArmVirtualNetwork.ps1
Get-ArmVirtualNetwork.ps1
Function Get-ArmVirtualNetwork { [CmdletBinding(DefaultParameterSetName='ByNothing')] Param ( [Parameter(Mandatory=$False,ParameterSetName='ByNameAndResourceGroupId',ValueFromPipeline=$false)] [Parameter(Mandatory=$False,ParameterSetName='ByNameAndResourceGroupName',ValueFromPipeline=$false)] ...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Completers/Location.ps1
Location.ps1
$ArgumentCompleter = @{ Command = @( "Get-ArmResourceGroup", "Get-ArmVmImage" ) Parameter = "Location" Description = "" ScriptBlock = { <# .SYNOPSIS .NOTES #> param($commandName, $parameterName, $wordToComplete, $com...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Completers/ResourceGroupName.ps1
ResourceGroupName.ps1
$ArgumentCompleter = @{ Command = @("Get-ArmResourceGroup", "Get-ArmVirtualMachine" ) Parameter = "ResourceGroupName" Description = "" ScriptBlock = { <# .SYNOPSIS .NOTES #> param($commandName, $parameterName, $wordToComplete, $...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Rest/Post-InternalRest.ps1
Post-InternalRest.ps1
Function Post-InternalRest { [CmdletBinding(DefaultParameterSetName='ReturnObject')] Param ( [Parameter(Mandatory=$true)] $Uri, [Parameter(Mandatory=$false)] $BearerToken, [Parameter(Mandatory=$false)] $ApiVersion, [Parameter(Mandatory=$false)] $ProviderName, [Par...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Rest/Get-InternalType.ps1
Get-InternalType.ps1
Function Get-InternalType { <# .Synopsis Gets the types that are currenty loaded in .NET, or gets information about a specific type .Description Gets all of the loaded types, or gets the possible values for an enumerated type or value. .Example # Gets all loaded...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Rest/Wait-InternalArmOperation.ps1
Wait-InternalArmOperation.ps1
Function Wait-InternalArmOperation { Param ( [String[]]$Uri, $InProgressStatus=202, $FinishedStatus=200, $ApiVersion ) $Counter = 1 $OperationIsFinished = $false $OperationStart = Get-Date #Loop while waiting until the statuscode turns from 202 (in progress) ...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Rest/Get-InternalRest.ps1
Get-InternalRest.ps1
Function Get-InternalRest { [CmdletBinding(DefaultParameterSetName='ReturnObject')] Param ( [Parameter(Mandatory=$true)] $Uri, [Parameter(Mandatory=$false)] $BearerToken, [Parameter(Mandatory=$false)] $ApiVersion, [Parameter(Mandatory=$false)] $ProviderName, [P...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Rest/Add-InternalType.ps1
Add-InternalType.ps1
Function Add-InternalType { Param ( [String]$TypeName, [switch]$IsRecursed ) #Check if we're good $TypeLoaded = $true try { $TypeText = Get-InternalType -Type $TypeName } catch { $TypeLoaded = $false } if ($TypeLoaded -eq $false) ...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Tests/envinfo.ps1
envinfo.ps1
write-output "PS version is: $($PSVersionTable.PSVersion.tostring())" Write-Output "OS version is: $(Get-WmiObject win32_operatingsystem | select -ExpandProperty version)" write-output "Here is: $(get-location | select -ExpandProperty path)" #$here = get-location | select -ExpandProperty path $ModuleFolderHere = get-l...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Tests/ConfigureTestEnvironment.ps1
ConfigureTestEnvironment.ps1
Param ($FilePath, [switch]$Force) $LocalVarsContent = Get-Content $FilePath -Raw $LocalVars = $LocalVarsContent | ConvertFrom-Json Foreach ($var in $LocalVars) { $VarName = $Var.Name Write-Verbose "Processing $varname" if (!(Get-Childitem "env:" | where {$_.Name -eq $VarName})) { $SetVar = $tr...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Tests/ResourceGroup/ResourceGroup.Tests.ps1
ResourceGroup.Tests.ps1
$ThisFolder = get-location | select -ExpandProperty path $TestsFolder = join-path $ThisFolder "Tests" Import-Module "$ThisFolder\blue.psd1" #Import-Module "$ModuleFolder\blue.psm1" -force if (Get-item "$ThisFolder\LocalVars.Config" -ErrorAction SilentlyContinue) { . "$TestsFolder\ConfigureTestEnvironment.ps1" -Fil...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Tests/Auth/Connect-ArmSubscription.Tests.ps1
Connect-ArmSubscription.Tests.ps1
$ThisFolder = get-location | select -ExpandProperty path $TestsFolder = join-path $ThisFolder "Tests" Import-Module "$ThisFolder\blue.psd1" #Import-Module "$ModuleFolder\blue.psm1" -force if (Get-item "$ThisFolder\LocalVars.Config" -ErrorAction SilentlyContinue) { . "$TestsFolder\ConfigureTestEnvironment.ps1" -Fil...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/TemplateDeployment/New-ArmTemplateDeployment.ps1
New-ArmTemplateDeployment.ps1
function New-ArmTemplateDeployment { [CmdletBinding()] Param ( [Parameter(Mandatory=$true,ParameterSetName='inputFile')] [ValidateScript({Test-Path $_})] $InputFile, [Parameter(Mandatory=$false,ParameterSetName='inputFile')] [ValidateScript({Test-Path $_})] ...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/Helpers/Invoke-InternalStringToArray.ps1
Invoke-InternalStringToArray.ps1
Function Invoke-InternalStringToArray { Param ($InputString) $TotalChars = $InputString.Length $CharArray = @() $ThisCounter = 0 Do { $CharArray += $InputString[$ThisCounter] $ThisCounter ++ } Until ($ThisCounter -eq $TotalChars) $TotalChars = $null $CharArray }
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/VirtualMachine/Start-ArmVirtualMachine.ps1
Start-ArmVirtualMachine.ps1
Function Start-ArmVirtualMachine { Param ( [Parameter(Mandatory=$False,ParameterSetName='ByObject',ValueFromPipeline=$true)] [Blue.VirtualMachine]$InputObject, [Switch]$Async ) Begin { #This is the basic test we do to ensure we have a valid connection to Azu...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/VirtualMachine/Stop-ArmVirtualMachine.ps1
Stop-ArmVirtualMachine.ps1
Function Stop-ArmVirtualMachine { Param ( [Parameter(Mandatory=$False,ParameterSetName='ByObject',ValueFromPipeline=$true)] [Blue.VirtualMachine]$InputObject, [Switch]$Async, [Switch]$StayProvisioned ) Begin { #This is the basic test we do to ensure ...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/VirtualMachine/Create-InternalArmVM.ps1
Create-InternalArmVM.ps1
Function Create-InternalArmVM { Param ( $VMName, $ResourceGroup, $Location, $VMSize, $VMImage, $StorageAccount, $StorageAccountContainer, $AdminUserName, $AdminPassword, $OsType, $NetworkInterfaceId ) $Crea...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/VirtualMachine/Get-ArmVmImage.ps1
Get-ArmVmImage.ps1
<# .Synopsis Gets a list of available VM Images .DESCRIPTION Lists available VM images in Azure. .EXAMPLE Get-ArmVmImage -Location "westeurope" -Publisher "Canonical" .EXAMPLE Get-ArmVmImage -Location "us" -Publisher "windows" .INPUTS .OUTPUTS A list of generic objects representing vm images. .NOTES ...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/VirtualMachine/Get-ArmVirtualMachine.ps1
Get-ArmVirtualMachine.ps1
Function Get-ArmVirtualMachine { [CmdletBinding()] Param ( [Parameter(Mandatory=$False,ParameterSetName='ByName',ValueFromPipeline=$True,Position=0)] [Parameter(Mandatory=$False,ParameterSetName='ByNameAndResourceGroupId',ValueFromPipeline=$false)] [Parameter(Mandatory=$False,ParameterSe...
PowerShellCorpus/PowerShellGallery/Blue/1.0.124/VirtualMachine/New-ArmVirtualMachine.ps1
New-ArmVirtualMachine.ps1
Function New-ArmVirtualMachine { [CmdletBinding(DefaultParameterSetName='ByNameAndResourceGroupName')] Param ( # Name of the VM to create [Parameter(Mandatory=$True,ParameterSetName='ByNameAndResourceGroupName',ValueFromPipeline=$false)] [Parameter(Mandatory=$True,ParameterSetName='ByNam...
PowerShellCorpus/PowerShellGallery/AjaySampleModule/0.1.0/testFile.ps1
testFile.ps1
function print-Hello { echo "Hello World" }
PowerShellCorpus/PowerShellGallery/PSStackExchange/1.0.3/Private/Join-Parts.ps1
Join-Parts.ps1
function Join-Parts { <# .SYNOPSIS Join strings with a specified separator. .DESCRIPTION Join strings with a specified separator. This strips out null values and any duplicate separator characters. See examples for clarification. .PARAMETER Separator Separator...
PowerShellCorpus/PowerShellGallery/PSStackExchange/1.0.3/Private/Add-ObjectDetail.ps1
Add-ObjectDetail.ps1
function Add-ObjectDetail { <# .SYNOPSIS Decorate an object with - A TypeName - New properties - Default parameters .DESCRIPTION Helper function to decorate an object with - A TypeName - New properties - Default paramet...
PowerShellCorpus/PowerShellGallery/PSStackExchange/1.0.3/Private/Get-SEData.ps1
Get-SEData.ps1
<# Helper function to abstract out paging and extraction of 'items' API docs: https://api.stackexchange.com/docs Paging details: https://api.stackexchange.com/docs/paging Note: Explicitly removed functionality to limit pagesize on final call based on MaxResults. If the pagesize ...
PowerShellCorpus/PowerShellGallery/PSStackExchange/1.0.3/Private/ConvertTo-UnixDate.ps1
ConvertTo-UnixDate.ps1
Function ConvertTo-UnixDate { <# .SYNOPSIS Convert from DateTime to Unix date .DESCRIPTION Convert from DateTime to Unix date .PARAMETER Date Date to convert .PARAMETER Utc Default behavior is to convert Date to universal time. Set this to false to skip this step....
PowerShellCorpus/PowerShellGallery/PSStackExchange/1.0.3/Private/ConvertFrom-UnixDate.ps1
ConvertFrom-UnixDate.ps1
Function ConvertFrom-UnixDate { <# .SYNOPSIS Convert from Unix time to DateTime .DESCRIPTION Convert from Unix time to DateTime .PARAMETER Date Date to convert, in Unix / Epoch format .PARAMETER Utc Default behavior is to convert Date to universal time. Se...
PowerShellCorpus/PowerShellGallery/PSStackExchange/1.0.3/Public/Get-SEAnswer.ps1
Get-SEAnswer.ps1
Function Get-SEAnswer { <# .SYNOPSIS Get answers from StackExchange .DESCRIPTION Get answers from StackExchange .PARAMETER Site StackExchange site to get questions from. Default is stackoverflow .PARAMETER QuestionID If specified, find answers from this specific qu...
PowerShellCorpus/PowerShellGallery/PSStackExchange/1.0.3/Public/Get-SEObject.ps1
Get-SEObject.ps1
Function Get-SEObject { <# .SYNOPSIS Get an object from StackExchange .DESCRIPTION Get an object from StackExchange .PARAMETER Object Type of object to query for. Accepts multiple parts. Example: 'sites' or 'questions/unanswered' .PARAMETER Uri The base Ur...
PowerShellCorpus/PowerShellGallery/PSStackExchange/1.0.3/Public/Get-SEQuestion.ps1
Get-SEQuestion.ps1
Function Get-SEQuestion { <# .SYNOPSIS Get questions from StackExchange .DESCRIPTION Get questions from StackExchange .PARAMETER Site StackExchange site to get questions from. Default is stackoverflow .PARAMETER Tag Search by tag Limited to 5 tags .PA...
PowerShellCorpus/PowerShellGallery/PSStackExchange/1.0.3/Public/Search-SEQuestion.ps1
Search-SEQuestion.ps1
Function Search-SEQuestion { <# .SYNOPSIS Search a StackExchange site for questions .DESCRIPTION Search a StackExchange site for questions .PARAMETER Title Text which must appear in returned questions' titles .PARAMETER Site StackExchange site. Default is stackover...
PowerShellCorpus/PowerShellGallery/xTimeZone/1.6.0.0/Examples/SetTimeZone.ps1
SetTimeZone.ps1
#--------------------------------------------------------------------------------- #The sample scripts are not supported under any Microsoft standard support #program or service. The sample scripts are provided AS IS without warranty #of any kind. Microsoft further disclaims all implied warranties including, ...
PowerShellCorpus/PowerShellGallery/xTimeZone/1.6.0.0/Tests/Unit/xTimeZone.Tests.ps1
xTimeZone.Tests.ps1
$Global:DSCModuleName = 'xTimeZone' $Global:DSCResourceName = 'xTimeZone' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` ...
PowerShellCorpus/PowerShellGallery/xTimeZone/1.6.0.0/Tests/Unit/TimezoneHelper.Tests.ps1
TimezoneHelper.Tests.ps1
[String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if (Get-Module -Name TimezoneHelper -ErrorAction SilentlyContinue) { Remove-Module -Name TimezoneHelper } Import-Module -Name (Join-Path -Path $moduleRoot -ChildPath 'DSCResources\TimezoneHel...
PowerShellCorpus/PowerShellGallery/xTimeZone/1.6.0.0/Tests/Integration/xTimeZone.config.ps1
xTimeZone.config.ps1
$TestTimeZone = [PSObject]@{ TimeZone = 'Pacific Standard Time' IsSingleInstance = 'Yes' } configuration xTimezone_Config { Import-DscResource -ModuleName xTimeZone node localhost { xTimeZone Integration_Test { TimeZone = $TestTimeZone.TimeZone ...
PowerShellCorpus/PowerShellGallery/xTimeZone/1.6.0.0/Tests/Integration/xTimeZone.Integration.Tests.ps1
xTimeZone.Integration.Tests.ps1
$Global:DSCModuleName = 'xTimezone' $Global:DSCResourceName = 'xTimezone' #region HEADER [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test-Path -Path (Join-Path -Path $moduleRoot -ChildPath 'DSCResource.Tests'))) -or ` ...
PowerShellCorpus/PowerShellGallery/PSRWODBC/2.0/Private/sqlcmd2.ps1
sqlcmd2.ps1
function Invoke-Sqlcmd2 { <# .SYNOPSIS Runs a T-SQL script. .DESCRIPTION Runs a T-SQL script. Invoke-Sqlcmd2 runs the whole scipt and only captures the first selected result set, such as the output of PRINT statements when -verbose parameter is specified. Paramaterized queries...
PowerShellCorpus/PowerShellGallery/DellBIOSProviderX86/1.2/Load-DellBIOSProvider.ps1
Load-DellBIOSProvider.ps1
<# Load-DellBIOSProvider.ps1 ############################################################################# Copyright 2015 Dell Inc. All rights reserved. THIS SOFTWARE IS DISTRIBUTED IN THE HOPE THAT IT WILL BE USEFUL, BUT IS PROVIDED “AS IS” WITHOUT ANY WARRANTY, EXPRESS, IMPLIED OR OTHERWISE, INCL...
PowerShellCorpus/PowerShellGallery/DellBIOSProviderX86/1.2/Read-DellBIOSPassword.ps1
Read-DellBIOSPassword.ps1
Function Read-DellBIOSPassword { <# .Synopsis Reads a Dell BIOS Password from secure string storage .Description Reads a Dell BIOS Password from secure string storage. .Notes Reads System.Security.SecureString from the default user path. .Example Read-DellBIOSPassword .Example...
PowerShellCorpus/PowerShellGallery/DellBIOSProviderX86/1.2/Set-DellAutoOnForSelectDays.ps1
Set-DellAutoOnForSelectDays.ps1
function Set-DellAutoOnForSelectDays { <# .Synopsis Configures the system's auto-on capabilities that control individual days .Description This CmdLet sets the Auto-on to select days and enables or disables the individual days to automatically power on the system on a pre fixed . If a BIOS pass...
PowerShellCorpus/PowerShellGallery/DellBIOSProviderX86/1.2/Write-DellBIOSPassword.ps1
Write-DellBIOSPassword.ps1
Function Write-DellBIOSPassword { <# .Synopsis Writes a Dell BIOS password from secure string storage .Description Writes a DellBIOS password to System.Security.SecureString in the local app directory of the user. .Example Write-DellBIOSPassword .Example $DellBIOSCredential = Wr...
PowerShellCorpus/PowerShellGallery/DellBIOSProviderX86/1.2/Get-DellBIOSPasswordPath.ps1
Get-DellBIOSPasswordPath.ps1
Function Get-DellBIOSPasswordPath{ PROCESS{ $result = new-Object 'System.Object' $FilePath = "$env:LOCALAPPDATA\Dell\DellBIOSProvider\Bios.Password.txt" $result | Add-Member -MemberType noteproperty -Name DellBIOSPwdFilePath -value $FilePath $result } } # SIG # Begin signature block # MIIVSQYJK...
PowerShellCorpus/PowerShellGallery/DellBIOSProviderX86/1.2/Clear-DellAdminPassword.ps1
Clear-DellAdminPassword.ps1
Function Clear-DellAdminPassword { <# .Synopsis Erases the Admin (Setup) BIOS password .Description This CmdLet clears the Admin password in BIOS. Provide the existing password using -Password parameter. .Example Clear-DellAdminPassword -Password <existing password> #> param( [Paramet...
PowerShellCorpus/PowerShellGallery/DellBIOSProviderX86/1.2/Set-Dell1stBootdevice.ps1
Set-Dell1stBootdevice.ps1
function Set-Dell1stBootdevice { <# .Synopsis Sets a bootdevice first in the boot sequence .Description This CmdLet sets a boot device first in the boot sequence. You can specify a substring of the name of the boot device. If a BIOS password (Admin or System password) is set, supply it using the -Pa...
PowerShellCorpus/PowerShellGallery/DellBIOSProviderX86/1.2/Get-DellBiosSettings.ps1
Get-DellBiosSettings.ps1
function Get-DellBiosSettings { <# .Synopsis retrieves all BIOS settings applicable to the system .Description This CmdLet retrieves the BIOS settings that are applicable to the system. .Example Get-DellBiosSettings #> BEGIN { } PROCESS { $DellBIOS = get-childitem -path DellS...
PowerShellCorpus/PowerShellGallery/DellBIOSProviderX86/1.2/DSC_SampleScripts/Sample_SecureKey.ps1
Sample_SecureKey.ps1
$KeyFile = "\\Machine1\MySecurePath\AES.key" $Key = New-Object Byte[] 16 # You can use 16, 24, or 32 for AES [Security.Cryptography.RNGCryptoServiceProvider]::Create().GetBytes($Key) $Key | out-file $KeyFile $PasswordFile = "\\Machine1\SharedPath\Password.txt" $Key_file = Get-Content $KeyFile $Password = "P@s...
PowerShellCorpus/PowerShellGallery/DellBIOSProviderX86/1.2/DSC_SampleScripts/Sample_MultipleNodes_2.ps1
Sample_MultipleNodes_2.ps1
#$pwwd=Get-Content "c:\temp\userpwd.txt" Configuration MultipleCatConfiguration { param ( [string]$ComputerName ) Import-DscResource -ModuleName DellBIOSProvider Node $ComputerName { POSTBehavior POSTBehaviorSettings #resource name { Category = "POSTBehavi...
PowerShellCorpus/PowerShellGallery/DellBIOSProviderX86/1.2/DSC_SampleScripts/Sample_PassingCredentials.ps1
Sample_PassingCredentials.ps1
#$pwwd=Get-Content "c:\temp\userpwd.txt" Configuration MultipleCatConfiguration { Import-DscResource -ModuleName DellBIOSProvider Node 10.94.43.77 { POSTBehavior POSTBehaviorSettings #resource name { Category = "POSTBehavior" Keypad = "EnabledByNumlock...
PowerShellCorpus/PowerShellGallery/DellBIOSProviderX86/1.2/DSC_SampleScripts/Sample_All.ps1
Sample_All.ps1
#$pwwd=Get-Content "c:\temp\userpwd.txt" Configuration MultipleCatConfiguration { Import-DscResource -ModuleName DellBIOSProvider Node localhost { POSTBehavior POSTBehaviorSettings #resource name { Category = "POSTBehavior" Keypad = "EnabledByNuml...
PowerShellCorpus/PowerShellGallery/DellBIOSProviderX86/1.2/DSC_SampleScripts/Sample_ChangeLCMMetaConfig.ps1
Sample_ChangeLCMMetaConfig.ps1
Configuration LCMForRef { param ( [string]$ComputerName ) Node $ComputerName { LocalConfigurationManager { ConfigurationMode = "ApplyAndAutoCorrect" } } } LCMForRef -ComputerName 10.94.174.165 $secpwd=ConvertTo-SecureString "dell_123" -AsPlainText -force $mycred=New-Object System.Management.Au...
PowerShellCorpus/PowerShellGallery/DellBIOSProviderX86/1.2/DSC_SampleScripts/Sample_POSTBehavior.ps1
Sample_POSTBehavior.ps1
#$pwwd=Get-Content "c:\temp\userpwd.txt" Configuration POSTBehaviorConfiguration { Import-DscResource -ModuleName DellBIOSProvider Node localhost { POSTBehavior POSTBehaviorSettings #resource name { Category = "POSTBehavior" Keypad = "En...