full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/PowerShellGallery/xPhp/1.2.0.0/Samples/UsingxPhpCompositeConfiguration.ps1 | UsingxPhpCompositeConfiguration.ps1 | # This configuration will, via the xPHP composite configuration:
# 1) Make sure IIS is installed
# 2) Make sure PHP is present
# 3) Make sure that PHP is registered with IIS
# 4) Make sure PHP is in the path
#
# ********* NOTE ***********
# PHP changes their download URLs frequently. Please verify the URL.
# T... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Private/ConvertFrom-LocalDate.ps1 | ConvertFrom-LocalDate.ps1 | <#
Helper function to convert a local format string to datetime
#>
function ConvertFrom-LocalDate()
{
[CmdletBinding()]
Param(
[Parameter(Mandatory = $true,HelpMessage = 'Date in your computer local date format',ValueFromPipeline = $true)]
[ValidateNotNullorEmpty()]
[String]$Date
)
... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Private/New-BodyString.ps1 | New-BodyString.ps1 | function New-BodyString($bodykeys,$parameters)
{
# The New-BodyString function is used to create a valid body payload
# $bodykeys = All of the body options available to the endpoint
# $parameters = All of the parameter options available within the parent function
# If sending a GET request, no body is needed
... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Private/Test-QueryParam.ps1 | Test-QueryParam.ps1 | function Test-QueryParam($querykeys,$parameters,$uri)
{
# The Submit-Request function is used to send data to an endpoint and then format the response for further use
# $querykeys = All of the query options available to the endpoint
# $parameters = All of the parameter options available within the parent function... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Private/Test-FilterObject.ps1 | Test-FilterObject.ps1 | function Test-FilterObject($filter,$result)
{
# The Test-FilterObject function is used to filter data that has been returned from an endpoint for specific objects important to the user
# $filter = The list of parameters that the user can use to filter response data. Each key is the parameter name without the "$" an... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Private/Test-VMwareConnection.ps1 | Test-VMwareConnection.ps1 | function Test-VMwareConnection()
{
# Must have only one vCenter connection open
# Potential future work: loop through all vCenter connections
# Code snipet blatantly stolen from Vester :)
If ($DefaultVIServers.Count -lt 1)
{
Write-Warning -Message 'Please connect to vCenter before running this command.'... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Private/Test-ReturnFilter.ps1 | Test-ReturnFilter.ps1 | function Test-ReturnFilter($object,$location,$result)
{
# The Test-ReturnFilter function is used to perform a search across response content for a particular value
# $object = The parent function's variable holding the user generated query data
# $location = The key/value pair that contains the name of the key ho... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Private/Test-RubrikCredential.ps1 | Test-RubrikCredential.ps1 | function Test-RubrikCredential($Username,[SecureString]$Password,$Credential)
{
Write-Verbose -Message 'Validate credential'
if ($Credential)
{
return $Credential
}
Write-Verbose -Message 'Validate username and password'
if ($Username -eq $null -or $Password -eq $null)
{
Write-Warning -Message '... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Private/New-QueryString.ps1 | New-QueryString.ps1 | function New-QueryString($query,$uri,$nolimit)
{
# The New-QueryString function is used to collect an array of query values and combine them into a valid URI
# $params = An array of query values that are added based on which $objects have been passed by the user
# $uri = The entire URI without any query values ad... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Private/Test-DateDifference.ps1 | Test-DateDifference.ps1 | function Test-DateDifference([array]$date,[datetime]$compare)
{
# The Test-DateDifference function is used to compare a series of dates against a desired date to find the closest matching date/time in the past
# Thus, a date/time that is one hour older than the request would be valid, but one hour in the future wou... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Private/Format-JSON.ps1 | Format-JSON.ps1 | <#
Helper JSON functions to resolve the ConvertFrom-JSON maxJsonLength limitation, which defaults to 2 MB
http://stackoverflow.com/questions/16854057/convertfrom-json-max-length/27125027
#>
function ExpandPayload($response)
{
[void][System.Reflection.Assembly]::LoadWithPartialName('System.Web.Extensions')
... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Private/New-URIString.ps1 | New-URIString.ps1 | function New-URIString($server,$endpoint,$id)
{
# The New-URIString function is used to build a valid URI
# $server = The Rubrik cluster IP or FQDN
# $endpoint = The endpoint path
# $id = An id value to be planted into the path or optionally at the end of the URI to retrieve a single object
Write-Verbose -Me... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Private/Submit-Request.ps1 | Submit-Request.ps1 | function Submit-Request($uri,$header,$method,$body)
{
# The Submit-Request function is used to send data to an endpoint and then format the response for further use
# $uri = The endpoint's URI
# $header = The header containing authentication details
# $method = The action (method) to perform on the endpoint
#... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Private/Test-ReturnFormat.ps1 | Test-ReturnFormat.ps1 | function Test-ReturnFormat($api,$result,$location)
{
# The Test-ReturnFormat function is used to remove any parent variables surrounding return data, such as encapsulating results in a "data" key
# $api = The API version
# $result = The unformatted API response content
# $location = The key/value pair that cont... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Private/Test-RubrikConnection.ps1 | Test-RubrikConnection.ps1 | function Test-RubrikConnection()
{
# Test to see if a session has been established to the Rubrik cluster
# If no token is found, this will throw an error and halt the script
# Otherwise, the token is loaded into the script's $Header var
Write-Verbose -Message 'Validate the Rubrik token exists'
if (-not $g... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Private/Test-QueryObject.ps1 | Test-QueryObject.ps1 | function Test-QueryObject($object,$location,$query)
{
# The Test-QueryObject function is used to build a custom query string for supported endpoints
# $object = The parent function's variable holding the user generated query data
# $location = The key/value pair that contains the correct query name value
# $par... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Private/Get-RubrikAPIData.ps1 | Get-RubrikAPIData.ps1 | <#
Helper function to retrieve API data from Rubrik
#>
function Get-RubrikAPIData($endpoint)
{
$api = @{
Example = @{
v1 = @{
Description = 'Details about the API endpoint'
URI = 'The URI expressed as /api/v#/endpoint'
Method = 'Method to use aga... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Private/Test-RubrikSLA.ps1 | Test-RubrikSLA.ps1 | Function Test-RubrikSLA($SLA,$Inherit,$DoNotProtect)
{
Write-Verbose -Message 'Determining the SLA Domain id'
if ($SLA)
{
$slaid = (Get-RubrikSLA -SLA $SLA).id
if ($slaid -eq $null)
{
throw "No SLA Domains were found that match $SLA"
}
return $slaid
}
if ($Inherit)
{
return ... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Private/Unblock-SelfSignedCert.ps1 | Unblock-SelfSignedCert.ps1 | <#
Helper function to allow self-signed certificates for HTTPS connections
This is required when using RESTful API calls over PowerShell
#>
function Unblock-SelfSignedCert()
{
Write-Verbose -Message 'Allowing self-signed certificates'
if ([System.Net.ServicePointManager]::CertificatePolicy -notlike 'T... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Remove-RubrikUnmanagedObject.ps1 | Remove-RubrikUnmanagedObject.ps1 | #Requires -Version 3
function Remove-RubrikUnmanagedObject
{
<#
.SYNOPSIS
Removes one or more unmanaged objects known to a Rubrik cluster
.DESCRIPTION
The Remove-RubrikUnmanagedObject cmdlet is used to remove unmanaged objects that have been stored in the cluster
In most cases, this w... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/New-RubrikSnapshot.ps1 | New-RubrikSnapshot.ps1 | #Requires -Version 3
function New-RubrikSnapshot
{
<#
.SYNOPSIS
Takes an on-demand Rubrik snapshot of a protected object
.DESCRIPTION
The New-RubrikSnapshot cmdlet will trigger an on-demand snapshot for a specific object (virtual machine, database, fileset, etc.)
.NOTES
Written... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/New-RubrikHost.ps1 | New-RubrikHost.ps1 | #requires -Version 3
function New-RubrikHost
{
<#
.SYNOPSIS
Registers a host with a Rubrik cluster.
.DESCRIPTION
The New-RubrikHost cmdlet is used to register a host with the Rubrik cluster. This could be a host leveraging the Rubrik Backup Service or directly as with the case of NAS shares... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/New-RubrikMount.ps1 | New-RubrikMount.ps1 | #Requires -Version 3
function New-RubrikMount
{
<#
.SYNOPSIS
Create a new Live Mount from a protected VM
.DESCRIPTION
The New-RubrikMount cmdlet is used to create a Live Mount (clone) of a protected VM and run it in an existing vSphere environment.
.NOTES
Written by... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Get-RubrikVersion.ps1 | Get-RubrikVersion.ps1 | #Requires -Version 3
function Get-RubrikVersion
{
<#
.SYNOPSIS
Connects to Rubrik and retrieves the current version
.DESCRIPTION
The Get-RubrikVersion cmdlet will retrieve the version of code that is actively running on the system.
.NOTES
Written by Chri... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Protect-RubrikVM.ps1 | Protect-RubrikVM.ps1 | #Requires -Version 3
function Protect-RubrikVM
{
<#
.SYNOPSIS
Connects to Rubrik and assigns an SLA to a virtual machine
.DESCRIPTION
The Protect-RubrikVM cmdlet will update a virtual machine's SLA Domain assignment within the Rubrik cluster.
The SLA Domain contains all poli... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Get-RubrikFileset.ps1 | Get-RubrikFileset.ps1 | #requires -Version 3
function Get-RubrikFileset
{
<#
.SYNOPSIS
Retrieves details on one or more filesets known to a Rubrik cluster
.DESCRIPTION
The Get-RubrikFileset cmdlet is used to pull a detailed data set from a Rubrik cluster on any number of filesets
A number of parameters exist... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Get-RubrikFilesetTemplate.ps1 | Get-RubrikFilesetTemplate.ps1 | #requires -Version 3
function Get-RubrikFilesetTemplate
{
<#
.SYNOPSIS
Retrieves details on one or more fileset templates known to a Rubrik cluster
.DESCRIPTION
The Get-RubrikFilesetTemplate cmdlet is used to pull a detailed data set from a Rubrik cluster on any number of fileset templates
... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Disconnect-Rubrik.ps1 | Disconnect-Rubrik.ps1 | #requires -Version 3
function Disconnect-Rubrik
{
<#
.SYNOPSIS
Disconnects from a Rubrik cluster
.DESCRIPTION
The Disconnect-Rubrik function is used to disconnect from a Rubrik cluster.
This is done by supplying the bearer token and requesting that the session be deleted.
.NOTE... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Get-RubrikRequest.ps1 | Get-RubrikRequest.ps1 | #Requires -Version 3
function Get-RubrikRequest
{
<#
.SYNOPSIS
Connects to Rubrik and retrieves details on an async request
.DESCRIPTION
The Get-RubrikRequest cmdlet will pull details on a request that was submitted to the distributed task framework.
This is helpful for t... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Get-RubrikSLA.ps1 | Get-RubrikSLA.ps1 | #Requires -Version 3
function Get-RubrikSLA
{
<#
.SYNOPSIS
Connects to Rubrik and retrieves details on SLA Domain(s)
.DESCRIPTION
The Get-RubrikSLA cmdlet will query the Rubrik API for details on all available SLA Domains.
Information on each domain will be repor... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/New-RubrikSLA.ps1 | New-RubrikSLA.ps1 | #Requires -Version 3
function New-RubrikSLA
{
<#
.SYNOPSIS
Creates a new Rubrik SLA Domain
.DESCRIPTION
The New-RubrikSLA cmdlet will build a new SLA Domain to provide policy-driven control over protected objects within the Rubrik fabric.
.NOTES
Written by Chris Wahl for commun... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Get-RubrikHost.ps1 | Get-RubrikHost.ps1 | #requires -Version 3
function Get-RubrikHost
{
<#
.SYNOPSIS
Retrieve summary information for all hosts that are registered with a Rubrik cluster.
.DESCRIPTION
The Get-RubrikHost cmdlet is used to retrive information on one or more hosts that are being protected with the Rubrik Backup Servic... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Set-RubrikVM.ps1 | Set-RubrikVM.ps1 | #requires -Version 3
function Set-RubrikVM
{
<#
.SYNOPSIS
Applies settings on one or more virtual machines known to a Rubrik cluster
.DESCRIPTION
The Set-RubrikVM cmdlet is used to apply updated settings from a Rubrik cluster on any number of virtual machines
... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Remove-RubrikHost.ps1 | Remove-RubrikHost.ps1 | #requires -Version 3
function Remove-RubrikHost
{
<#
.SYNOPSIS
Delete host by specifying the host ID.
.DESCRIPTION
The Remove-RubrikHost cmdlet is used to remove a host registered with the Rubrik cluster.
.NOTES
Written by Chris Wahl for community usage
Twitter: @ChrisWah... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Remove-RubrikReport.ps1 | Remove-RubrikReport.ps1 | #Requires -Version 3
function Remove-RubrikReport
{
<#
.SYNOPSIS
Removes one or more reports created in Rubrik Envision
.DESCRIPTION
The Remove-RubrikReport cmdlet is used to delete any number of Rubrik Envision reports
.NOTES
Written by Chris Wahl for community usage
Twi... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Export-RubrikReport.ps1 | Export-RubrikReport.ps1 | #requires -Version 3
function Export-RubrikReport
{
<#
.SYNOPSIS
Retrieves link to a CSV file for a Rubrik Envision report
.DESCRIPTION
The Export-RubrikReport cmdlet is used to pull the link to a CSV file for a Rubrik Envision report
.NOTES
Written by Bas Vinken for community ... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Protect-RubrikDatabase.ps1 | Protect-RubrikDatabase.ps1 | #Requires -Version 3
function Protect-RubrikDatabase
{
<#
.SYNOPSIS
Connects to Rubrik and assigns an SLA to a database
.DESCRIPTION
The Protect-RubrikDatabase cmdlet will update a database's SLA Domain assignment within the Rubrik cluster.
The SLA Domain contains all policy... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Set-RubrikBlackout.ps1 | Set-RubrikBlackout.ps1 | #Requires -Version 3
function Set-RubrikBlackout
{
<#
.SYNOPSIS
Connects to Rubrik and sets blackout (stops/starts all snaps)
.DESCRIPTION
The Set-RubrikBlackout cmdlet will accept a flag of true/false to set cluster blackout
.NOTES
Written by Pete Milanese for community usage
... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Remove-RubrikMount.ps1 | Remove-RubrikMount.ps1 | #Requires -Version 3
function Remove-RubrikMount
{
<#
.SYNOPSIS
Connects to Rubrik and removes one or more live mounts
.DESCRIPTION
The Remove-RubrikMount cmdlet is used to request the deletion of one or more instant mounts
.NOTES
Written by Chris Wahl f... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Get-RubrikMount.ps1 | Get-RubrikMount.ps1 | #Requires -Version 3
function Get-RubrikMount
{
<#
.SYNOPSIS
Connects to Rubrik and retrieves details on mounts for a VM
.DESCRIPTION
The Get-RubrikMount cmdlet will accept a VM id and return details on any mount operations that are active within Rubrik
Due to the nature o... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Get-RubrikDatabase.ps1 | Get-RubrikDatabase.ps1 | #requires -Version 3
function Get-RubrikDatabase
{
<#
.SYNOPSIS
Retrieves details on one or more databases known to a Rubrik cluster
.DESCRIPTION
The Get-RubrikDatabase cmdlet is used to pull a detailed data set from a Rubrik cluster on any number of databases.
To narrow down the resu... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Get-RubrikSnapshot.ps1 | Get-RubrikSnapshot.ps1 | #Requires -Version 3
function Get-RubrikSnapshot
{
<#
.SYNOPSIS
Retrieves all of the snapshots (backups) for any given object
.DESCRIPTION
The Get-RubrikSnapshot cmdlet is used to query the Rubrik cluster for all known snapshots (backups) for any protected object
The correct API... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Sync-RubrikAnnotation.ps1 | Sync-RubrikAnnotation.ps1 | #Requires -Version 3
function Sync-RubrikAnnotation
{
<#
.SYNOPSIS
Applies Rubrik SLA Domain information to VM Annotations using the Custom Attributes feature in vCenter
.DESCRIPTION
The Sync-RubrikAnnotation cmdlet will comb through all VMs currently being protected by Rubrik.
It wil... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Get-RubrikUnmanagedObject.ps1 | Get-RubrikUnmanagedObject.ps1 | #requires -Version 3
function Get-RubrikUnmanagedObject
{
<#
.SYNOPSIS
Retrieves details on one or more unmanaged objects known to a Rubrik cluster
.DESCRIPTION
The Get-RubrikUnmanagedObject cmdlet is used to pull details on any unmanaged objects that has been stored in the cluster
In... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Protect-RubrikFileset.ps1 | Protect-RubrikFileset.ps1 | #Requires -Version 3
function Protect-RubrikFileset
{
<#
.SYNOPSIS
Connects to Rubrik and assigns an SLA to a fileset
.DESCRIPTION
The Protect-RubrikFileset cmdlet will update a fileset's SLA Domain assignment within the Rubrik cluster.
The SLA Domain contains all policy-dri... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Remove-RubrikSLA.ps1 | Remove-RubrikSLA.ps1 | #Requires -Version 3
function Remove-RubrikSLA
{
<#
.SYNOPSIS
Connects to Rubrik and removes SLA Domains
.DESCRIPTION
The Remove-RubrikSLA cmdlet will request that the Rubrik API delete an SLA Domain.
The SLA Domain must have zero protected objects (VMs, filesets, databas... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Remove-RubrikFileset.ps1 | Remove-RubrikFileset.ps1 | #requires -Version 3
function Remove-RubrikFileset
{
<#
.SYNOPSIS
Delete a fileset by specifying the fileset ID
.DESCRIPTION
The Remove-RubrikFileset cmdlet is used to remove a fileset registered with the Rubrik cluster.
.NOTES
Written by Chris Wahl for community usage
Tw... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Get-RubrikVM.ps1 | Get-RubrikVM.ps1 | #requires -Version 3
function Get-RubrikVM
{
<#
.SYNOPSIS
Retrieves details on one or more virtual machines known to a Rubrik cluster
.DESCRIPTION
The Get-RubrikVM cmdlet is used to pull a detailed data set from a Rubrik cluster on any number of virtual machines
.NOTES
Written ... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Get-RubrikReport.ps1 | Get-RubrikReport.ps1 | #requires -Version 3
function Get-RubrikReport
{
<#
.SYNOPSIS
Retrieves details on one or more reports created in Rubrik Envision
.DESCRIPTION
The Get-RubrikReport cmdlet is used to pull information on any number of Rubrik Envision reports
.NOTES
Written by Chris Wahl for commu... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Protect-RubrikTag.ps1 | Protect-RubrikTag.ps1 | #Requires -Version 3
function Protect-RubrikTag
{
<#
.SYNOPSIS
Connects to Rubrik and assigns an SLA Domain based on a vSphere category and tag value
.DESCRIPTION
The Protect-RubrikTag cmdlet will update a virtual machine's SLA Domain assignment within the Rubrik cluster.
The SLA Domai... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Set-RubrikMount.ps1 | Set-RubrikMount.ps1 | #requires -Version 3
function Set-RubrikMount
{
<#
.SYNOPSIS
Powers on/off a live mounted virtual machine within a connected Rubrik vCenter.
.DESCRIPTION
The Set-RubrikMount cmdlet is used to send a power on request to mounted virtual machine visible to a Rubrik cluster.
.NOTES
... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Sync-RubrikTag.ps1 | Sync-RubrikTag.ps1 | #Requires -Version 3
function Sync-RubrikTag
{
<#
.SYNOPSIS
Connects to Rubrik and creates a vSphere tag for each SLA Domain
.DESCRIPTION
The Sync-RubrikTag cmdlet will query Rubrik for all of the existing SLA Domains, and then create a tag for each one
.NOTES
Written by Chris ... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Connect-Rubrik.ps1 | Connect-Rubrik.ps1 | #Requires -Version 3
function Connect-Rubrik
{
<#
.SYNOPSIS
Connects to Rubrik and retrieves a token value for authentication
.DESCRIPTION
The Connect-Rubrik function is used to connect to the Rubrik RESTful API and supply credentials to the /login method.
Rubrik then returns a uniqu... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Export-RubrikDatabase.ps1 | Export-RubrikDatabase.ps1 | #Requires -Version 3
function Export-RubrikDatabase
{
<#
.SYNOPSIS
Connects to Rubrik exports a database to a MSSQL instance
.DESCRIPTION
The Export-RubrikDatabase command will request a database export from a Rubrik Cluster to a MSSQL instance
.NOTES
Written by Pete Milanese for... |
PowerShellCorpus/PowerShellGallery/Rubrik/3.1.0.27/Public/Move-RubrikMountVMDK.ps1 | Move-RubrikMountVMDK.ps1 | #Requires -Version 3
function Move-RubrikMountVMDK
{
<#
.SYNOPSIS
Moves the VMDKs from a Live Mount to another VM
.DESCRIPTION
The Move-RubrikMountVMDK cmdlet is used to attach VMDKs from a Live Mount to another VM, typically for restore or testing purposes.
.NOTES
Written by C... |
PowerShellCorpus/PowerShellGallery/PPoShSqlTools/1.0.3/Private/Invoke-SqlSqlCmd.ps1 | Invoke-SqlSqlCmd.ps1 | function Invoke-SqlSqlcmd {
<#
.SYNOPSIS
Runs a T-SQL script using sqlcmd.exe.
.DESCRIPTION
Runs sql command or sql script file. Gives proper error handling as opposed to Invoke-Sqlcmd.
See https://connect.microsoft.com/SQLServer/feedback/details/779320/invoke-sqlcmd-does-not-return-t-s... |
PowerShellCorpus/PowerShellGallery/PPoShSqlTools/1.0.3/Private/Get-CurrentSqlCmdPath.ps1 | Get-CurrentSqlCmdPath.ps1 | function Get-CurrentSqlCmdPath {
<#
.SYNOPSIS
Returns sqlcmd.exe folder path
.DESCRIPTION
Search for sqlcmd bin path in system registry. First found version will be returned.
.EXAMPLE
Get-CurrentSqlCmdPath
#>
[CmdletBinding()]
[OutputType([string])]
param()
$sqlS... |
PowerShellCorpus/PowerShellGallery/PPoShSqlTools/1.0.3/Private/Invoke-SqlDotNet.ps1 | Invoke-SqlDotNet.ps1 | function Invoke-SqlDotNet {
<#
.SYNOPSIS
Runs a T-SQL script using .NET SqlCommand.
.DESCRIPTION
Useful especially when neither SMO nor sqlcmd are available.
.EXAMPLE
Invoke-SqlDotNet -ConnectionString $connectionString -Sql $Query -SqlCmdVariables $param
#>
[CmdletBi... |
PowerShellCorpus/PowerShellGallery/PPoShSqlTools/1.0.3/Public/New-SqlDatabase.ps1 | New-SqlDatabase.ps1 | function New-SqlDatabase {
<#
.SYNOPSIS
Creates a new SQL Server database with default settings and simple recovery mode.
.DESCRIPTION
Creates database using New-SqlDatabase.sql script with default settings.
.EXAMPLE
New-SqlDatabase -DatabaseName "MyDb" -ConnectionString "Da... |
PowerShellCorpus/PowerShellGallery/PPoShSqlTools/1.0.3/Public/Start-RestoreSqlDatabase.ps1 | Start-RestoreSqlDatabase.ps1 | function Start-RestoreSqlDatabase {
<#
.SYNOPSIS
Restores database on MSSQL Server.
.DESCRIPTION
Uses Start-RestoreSqlDatabase.sql sql script to restore database.
.EXAMPLE
Start-RestoreSqlDatabase -DatabaseName "DbName" -ConnectionString "data source=localhost;integrated... |
PowerShellCorpus/PowerShellGallery/PPoShSqlTools/1.0.3/Public/Set-SqlServerFilestream.ps1 | Set-SqlServerFilestream.ps1 | function Set-SqlServerFilestream {
<#
.SYNOPSIS
Sets SQL Server Filestream to given level.
.DESCRIPTION
It does the following:
1. Check filestream is at given level globally on SQL Server instance level, and if not set it using Cim/WMI.
2. If level has been changed restart SQL Server servi... |
PowerShellCorpus/PowerShellGallery/PPoShSqlTools/1.0.3/Public/Start-SqlServerAgentJob.ps1 | Start-SqlServerAgentJob.ps1 | function Start-SqlServerAgentJob {
<#
.SYNOPSIS
Starts a SQL Server Agent job, synchronously or asynchronously.
.EXAMPLE
Start-SqlServerAgentJob -JobName 'MyJob' -ConnectionString $Tokens.DatabaseConfig.DatabaseDeploymentConnectionString
#>
[CmdletBinding()]
[OutputType([void])]... |
PowerShellCorpus/PowerShellGallery/PPoShSqlTools/1.0.3/Public/Start-BackupSqlDatabase.ps1 | Start-BackupSqlDatabase.ps1 | function Start-BackupSqlDatabase {
<#
.SYNOPSIS
Creates SQL database backup.
.DESCRIPTION
Uses Invoke-Sql cmdlet to run Start-BackupSqlDatabase SQL script to backup database.
.EXAMPLE
Start-BackupSqlDatabase -DatabaseName "DbName" -ConnectionString "Data Source=localhost;Int... |
PowerShellCorpus/PowerShellGallery/PPoShSqlTools/1.0.3/Public/New-SqlUser.ps1 | New-SqlUser.ps1 | function New-SqlUser {
<#
.SYNOPSIS
Creates or updates user on given database. It also remaps user to the login.
.EXAMPLE
New-SqlUser -ConnectionString $connectionString -DatabaseName "database" -Username "username" -DbRole "db_owner|db_datareader"
#>
[CmdletBinding()]
[... |
PowerShellCorpus/PowerShellGallery/PPoShSqlTools/1.0.3/Public/Invoke-Sql.ps1 | Invoke-Sql.ps1 | function Invoke-Sql {
<#
.SYNOPSIS
Runs a T-SQL script using .NET classes (default, no prerequisites needed) or sqlcmd.exe.
.DESCRIPTION
Runs sql command or sql script file .
.OUTPUTS
String if Mode = sqlcmd.
System.Data.DataSet if Mode = .net.
.EXAMPLE
... |
PowerShellCorpus/PowerShellGallery/PPoShSqlTools/1.0.3/Public/New-SqlLogin.ps1 | New-SqlLogin.ps1 | function New-SqlLogin {
<#
.SYNOPSIS
Creates or updates database login on MSSQL Server.
.EXAMPLE
New-SqlLogin -ConnectionString "data source=localhost;integrated security=True" -Credentials (Get-Credential)
#>
[CmdletBinding()]
[OutputType([void])]
param(
[Parame... |
PowerShellCorpus/PowerShellGallery/PPoShSqlTools/1.0.3/Public/Remove-SqlDatabase.ps1 | Remove-SqlDatabase.ps1 | function Remove-SqlDatabase {
<#
.SYNOPSIS
Remove database from MSSQL Server.
.DESCRIPTION
Drops database using Remove-SqlDatabase.sql script. Does nothing when database does not exists.
.EXAMPLE
Remove-SqlDatabase -DatabaseName "MyDb" -ConnectionString "data source=localhos... |
PowerShellCorpus/PowerShellGallery/xSCSR/1.3.0.0/Examples/SCSR-SingleServer.ps1 | SCSR-SingleServer.ps1 | #requires -Version 5
Configuration SR
{
Import-DscResource -Module xSQLServer
Import-DscResource -Module xSCSR
# Set role and instance variables
$Roles = $AllNodes.Roles | Sort-Object -Unique
foreach($Role in $Roles)
{
$Servers = @($AllNodes.Where{$_.Roles | Where-Object {$_... |
PowerShellCorpus/PowerShellGallery/xSCSR/1.3.0.0/Examples/SCSR-SeperateSQL.ps1 | SCSR-SeperateSQL.ps1 | #requires -Version 5
Configuration SR
{
Import-DscResource -Module xSQLServer
Import-DscResource -Module xSCSR
# Set role and instance variables
$Roles = $AllNodes.Roles | Sort-Object -Unique
foreach($Role in $Roles)
{
$Servers = @($AllNodes.Where{$_.Roles | Where-Object {$_... |
PowerShellCorpus/PowerShellGallery/xSCSR/1.3.0.0/Examples/SCSR-SingleServer-TP.ps1 | SCSR-SingleServer-TP.ps1 | #requires -Version 5
Configuration SR
{
Import-DscResource -Module xSQLServer
Import-DscResource -Module xSCSR
# Set role and instance variables
$Roles = $AllNodes.Roles | Sort-Object -Unique
foreach($Role in $Roles)
{
$Servers = @($AllNodes.Where{$_.Roles | Where-Object {$_... |
PowerShellCorpus/PowerShellGallery/xSCSR/1.3.0.0/Examples/SCSR-SeperateSQL-TP.ps1 | SCSR-SeperateSQL-TP.ps1 | #requires -Version 5
Configuration SR
{
Import-DscResource -Module xSQLServer
Import-DscResource -Module xSCSR
# Set role and instance variables
$Roles = $AllNodes.Roles | Sort-Object -Unique
foreach($Role in $Roles)
{
$Servers = @($AllNodes.Where{$_.Roles | Where-Object {$_... |
PowerShellCorpus/PowerShellGallery/pshtmltable/0.0.1/Public/ConvertTo-PropertyValue.ps1 | ConvertTo-PropertyValue.ps1 | function ConvertTo-PropertyValue {
<#
.SYNOPSIS
Convert an object with various properties into an array of property, value pairs
.DESCRIPTION
Convert an object with various properties into an array of property, value pairs
If you output reports or other formats where a table with one long... |
PowerShellCorpus/PowerShellGallery/pshtmltable/0.0.1/Public/New-HTMLHead.ps1 | New-HTMLHead.ps1 | function New-HTMLHead {
<#
.SYNOPSIS
Returns HTML including internal style sheet
.DESCRIPTION
Returns HTML including internal style sheet
.PARAMETER cssPath
If specified, contents of this file are embedded in an internal style sheet via <style> tags
Note: If y... |
PowerShellCorpus/PowerShellGallery/pshtmltable/0.0.1/Public/Add-HTMLTableColor.ps1 | Add-HTMLTableColor.ps1 | function Add-HTMLTableColor {
<#
.SYNOPSIS
Colorize cells or rows in an HTML table, or add other inline CSS
.DESCRIPTION
Colorize cells or rows in an HTML table, or add other inline CSS
.PARAMETER HTML
HTML string to work with
.PARAMETER Column
If specified, the column yo... |
PowerShellCorpus/PowerShellGallery/pshtmltable/0.0.1/Public/Close-HTML.ps1 | Close-HTML.ps1 | function Close-HTML {
<#
.SYNOPSIS
Close out the body and html tags
.DESCRIPTION
Close out the body and html tags
.PARAMETER HTML
HTML string to work with
.PARAMETER Decode
If specified, run HTML string through HtmlDecode
.EXAMPLE
#This example requires and demonst... |
PowerShellCorpus/PowerShellGallery/pshtmltable/0.0.1/Public/New-HTMLTable.ps1 | New-HTMLTable.ps1 | function New-HTMLTable {
<#
.SYNOPSIS
Create an HTML table from an input object
.DESCRIPTION
Create an HTML table from an input object
.PARAMETER InputObject
One or more objects (ie. (Get-process | select Name,Company)
.PARAMETER Properties
If specified, limit table to th... |
PowerShellCorpus/PowerShellGallery/Cache/1.0.3.90/imports.ps1 | imports.ps1 | # grab functions from files
get-childitem $psscriptroot\functions\ -filter "*.ps1" |
? { -not ($_.name.Contains(".Tests.")) } |
? { -not (($_.name).StartsWith("_")) } |
% { . $_.fullname }
|
PowerShellCorpus/PowerShellGallery/Cache/1.0.3.90/functions/Export-Cache.ps1 | Export-Cache.ps1 | function _SanitizeContainerName([Parameter(Mandatory=$true, ValueFromPipeline=$true)]$container) {
return $container.Replace("\","_").Replace("/","_").Replace(":","_")
}
function export-cache([Parameter(Mandatory=$true,ValueFromPipeline=$true)]$data, [Parameter(Mandatory=$true)]$container, [Parameter(Mandatory=$fa... |
PowerShellCorpus/PowerShellGallery/Cache/1.0.3.90/functions/objectcache.ps1 | objectcache.ps1 | <#
.Synopsis
Stores an object in in-memory cache. The object is valid as long as lockfile has not changed
#>
function set-cachedobject([Parameter(Mandatory=$true)]$lockfile, [Parameter(Mandatory=$true)]$object) {
if (!(test-path $lockfile)) { throw "lock file '$lockfile' not found" }
$f = gi $lockfile
$ts ... |
PowerShellCorpus/PowerShellGallery/Cache/1.0.3.90/functions/Export-Credentials.ps1 | Export-Credentials.ps1 |
function export-credentials([Parameter(Mandatory=$true)]$container, $cred, [Alias("dir")]$cacheDir = "pscredentials") {
$pass = $null
if (![string]::isnullorempty($cred.Password)) {
$pass = $cred.Password | ConvertFrom-SecureString
}
$result = New-Object -TypeName pscustomobject -Property @{ ... |
PowerShellCorpus/PowerShellGallery/require/1.1.7.90/functions/helpers.ps1 | helpers.ps1 |
######## helpers: ###################
function install-chocolatey ($version = $null) {
if (!(test-choco)) {
Write-Warning "chocolatey not found, installing"
#$version = "0.9.8.33"
$s = (new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1')
if ($versio... |
PowerShellCorpus/PowerShellGallery/FileSystemForms/1.0.0.0/Select-FileSystemForm.ps1 | Select-FileSystemForm.ps1 | Function Select-FileSystemForm
{
<#
.SYNOPSIS
Open or save files or open folders using Windows forms.
.DESCRIPTION
Launch a Windows form to allow user selction of files and folders on local or network files systems.
.PARAMETER Start
[string] The start directory fo... |
PowerShellCorpus/PowerShellGallery/Twilio/0.9/Get-TwilioTranscription.ps1 | Get-TwilioTranscription.ps1 | function Get-TwilioTranscription
{
<#
.Synopsis
Gets Twilio call Transcriptions
.Description
Get Transcriptions from Twilio calls
.Example
Get-TwilioTranscription
.Link
Twilio.com
.Link
Get-PhoneCall
#>
param(
# The creden... |
PowerShellCorpus/PowerShellGallery/Twilio/0.9/Get-PhoneCall.ps1 | Get-PhoneCall.ps1 | function Get-PhoneCall
{
<#
.Synopsis
Gets information about phone calls
.Description
Gets information about phone calls sent to or from any Twilio Number
.Example
Get-PhoneCall
#>
param(
# The call identifier
[Parameter(ValueFromPipelineByPropertyN... |
PowerShellCorpus/PowerShellGallery/Twilio/0.9/Get-ConferenceCall.ps1 | Get-ConferenceCall.ps1 | function Get-ConferenceCall
{
<#
.Synopsis
Gets conference calls
.Description
Get conference calls that occured on a Twilio number
.Example
Get-ConferenceCall
.Link
Twilio.com
.Link
Send-TextMessage
#>
param(
# The credent... |
PowerShellCorpus/PowerShellGallery/Twilio/0.9/Add-TwilioQueue.ps1 | Add-TwilioQueue.ps1 | function Add-TwilioQueue
{
<#
#>
param(
# The friendly name of the queue
[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)]
[string]
$FriendlyName,
# The Twilio credential
[Parameter(ValueFromPipelineByPropertyName=$true)]
[Management.Automation.PSCr... |
PowerShellCorpus/PowerShellGallery/Twilio/0.9/Get-TwilioQueue.ps1 | Get-TwilioQueue.ps1 | function Get-TwilioQueue
{
<#
.Synopsis
Gets the Twilio queue
.Description
Gets Twilio queues
.Example
Get-TwilioQueue
#>
param(
# The name of the queue
[Parameter(ValueFromPipelineByPropertyName=$true)]
[string]
$Name = "*",
... |
PowerShellCorpus/PowerShellGallery/Twilio/0.9/Get-TwilioCredential.ps1 | Get-TwilioCredential.ps1 | None |
PowerShellCorpus/PowerShellGallery/Twilio/0.9/Confirm-IncomingNumber.ps1 | Confirm-IncomingNumber.ps1 | function Confirm-IncomingNumber
{
<#
.Synopsis
Confirms a phone number to accept incoming calls
.Description
.Example
#>
param(
# The phone number that is being confirmed. The number _must_ be in [E.164](http://en.wikipedia.org/wiki/E.164) (+${CountryCode}{Num... |
PowerShellCorpus/PowerShellGallery/Twilio/0.9/Remove-OutgoingNumber.ps1 | Remove-OutgoingNumber.ps1 | None |
PowerShellCorpus/PowerShellGallery/Twilio/0.9/Get-TwilioNumber.ps1 | Get-TwilioNumber.ps1 | function Get-TwilioNumber
{
<#
.Synopsis
Gets Twilio phone numbers
.Description
Gets numbers assoicated with a Twilio account, or finds a new number
#>
[CmdletBinding(DefaultParameterSetName='OwnedNumbers')]
param(
[Management.Automation.PSCredential]
... |
PowerShellCorpus/PowerShellGallery/Twilio/0.9/Get-OutgoingNumber.ps1 | Get-OutgoingNumber.ps1 | None |
PowerShellCorpus/PowerShellGallery/Twilio/0.9/Set-TwilioCredential.ps1 | Set-TwilioCredential.ps1 | None |
PowerShellCorpus/PowerShellGallery/Twilio/0.9/Confirm-OutgoingNumber.ps1 | Confirm-OutgoingNumber.ps1 | function Confirm-OutgoingNumber
{
<#
.Synopsis
Confirms a phone number to send outgoing calls
.Description
.Example
#>
param(
# The phone number that is being confirmed
[Parameter(Mandatory=$true,ValueFromPipelineByPropertyName=$true)]
[string]
$... |
PowerShellCorpus/PowerShellGallery/Twilio/0.9/Send-PhoneCall.ps1 | Send-PhoneCall.ps1 | function Send-PhoneCall
{
<#
.Synopsis
Sends text messages
.Description
Sends text messages with twilio
.Example
# Looks up a phone number location and texts the url of a map to that #
Search-WolframAlpha -For "1-206-607-6555" -ApiKeySetting WolframAlphaApiKey |... |
PowerShellCorpus/PowerShellGallery/Twilio/0.9/Get-TextMessage.ps1 | Get-TextMessage.ps1 | function Get-TextMessage
{
<#
.Synopsis
Gets text messages
.Description
Get text messages sent to a Twilio number
.Example
Get-TextMessage
.Link
Twilio.com
.Link
Send-TextMessage
#>
param(
# The credential used to get the t... |
PowerShellCorpus/PowerShellGallery/Twilio/0.9/Set-TwilioNumber.ps1 | Set-TwilioNumber.ps1 | None |
PowerShellCorpus/PowerShellGallery/Twilio/0.9/Get-TwilioApplication.ps1 | Get-TwilioApplication.ps1 | function Get-TwilioApplication
{
param(
[Management.Automation.PSCredential]
$Credential
)
process {
if (-not $Credential) {
$credential = Get-TwilioCredential -ValueOnly | Select-Object -First 1
}
if (-not $Credential) {
... |
PowerShellCorpus/PowerShellGallery/Twilio/0.9/Send-TextMessage.ps1 | Send-TextMessage.ps1 | function Send-TextMessage
{
<#
.Synopsis
Sends text messages
.Description
Sends text messages with twilio
.Example
# Looks up a phone number location and texts the url of a map to that #
Search-WolframAlpha -For "1-206-607-6555" -ApiKeySetting WolframAlphaApiKey... |
PowerShellCorpus/PowerShellGallery/Twilio/0.9/Remove-TwilioQueue.ps1 | Remove-TwilioQueue.ps1 | function Remove-TwilioQueue
{
<#
.Synopsis
Removes a Twilio Queue
.Description
Removes a Queue from Twilio
.Example
Remove-TwilioQueue
#>
[CmdletBinding(SupportsShouldProcess=$true)]
[OutputType([Nullable])]
param(
[Parameter(Mandatory=$true,Pa... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.