full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/PowerShellGallery/PsLANDesk/1.13/Functions/Get-LANDeskTaskList.ps1 | Get-LANDeskTaskList.ps1 | Function Get-LANDeskTaskList
{
<#
.SYNOPSIS
Lists the tasks on the landesk server.
.DESCRIPTION
Lists the tasks on the LANDesk server and creates an object that can be piped to other functions.
.EXAMPLE
Get-LANDeskTaskList
Outputs a list of all of the LANDesk scheduled tasks as ... |
PowerShellCorpus/PowerShellGallery/PsLANDesk/1.13/Functions/Get-LANDeskQueries.ps1 | Get-LANDeskQueries.ps1 | Function Get-LANDeskQueries
{
<#
.SYNOPSIS
The Get-LANDeskQueries function returns a list of queries available to be run.
.DESCRIPTION
A detailed description of the Get-LANDeskQueries function.
.EXAMPLE
Get-LANDeskQueries
Returns a list of LANDesk queries.
.EXAMPLE
$... |
PowerShellCorpus/PowerShellGallery/PsLANDesk/1.13/Functions/Get-LANDeskColumnSetColumns.ps1 | Get-LANDeskColumnSetColumns.ps1 | Function Get-LANDeskColumnSetColumns
{
<#
.SYNOPSIS
The Get-LANDeskColumnSetColumns function returns a list of available Column sets.
.DESCRIPTION
The Get-LANDeskColumnSetColumns function returns a list of available Column sets. This can be used to determine the columns available to each set.
... |
PowerShellCorpus/PowerShellGallery/PsLANDesk/1.13/Functions/Get-LANDeskMachineVulnerabilities.ps1 | Get-LANDeskMachineVulnerabilities.ps1 | Function Get-LANDeskMachineVulnerabilities
{
<#
.SYNOPSIS
The Get-LANDeskMachineVulnerabilities function returns the vulnerabilities for specified device.
.DESCRIPTION
The Get-LANDeskMachineVulnerabilities function returns the vulnerabilities for specified device and sorts them by severity.
... |
PowerShellCorpus/PowerShellGallery/PsLANDesk/1.13/Functions/Remove-LANDeskScheduledTask.ps1 | Remove-LANDeskScheduledTask.ps1 | Function Remove-LANDeskScheduledTask
{
<#
.SYNOPSIS
The Remove-LANDeskScheduledTask function removes the specified LANDesk task.
.DESCRIPTION
The Remove-LANDeskScheduledTask function removes the specified LANDesk task. Requires the ID number of the task to check which can be found by right-clicki... |
PowerShellCorpus/PowerShellGallery/PsLANDesk/1.13/Functions/Get-LANDeskTaskMachineStatus.ps1 | Get-LANDeskTaskMachineStatus.ps1 | Function Get-LANDeskTaskMachineStatus
{
<#
.SYNOPSIS
The Get-LANDeskTaskMachineStatus function returns the status of the specified LANDesk task.
.DESCRIPTION
The Get-LANDeskTaskMachineStatus function returns the status of the specified LANDesk task. Requires the ID number of the task to check whi... |
PowerShellCorpus/PowerShellGallery/PsLANDesk/1.13/Functions/Start-LANDeskQuery.ps1 | Start-LANDeskQuery.ps1 | Function Start-LANDeskQuery
{
<#
.SYNOPSIS
The Start-LANDeskQuery function runs the specified LANDesk query and returns the results.
.DESCRIPTION
The Start-LANDeskQuery function runs the specified LANDesk query and returns the results using the Webservice object.
.PARAMETER QueryName
Th... |
PowerShellCorpus/PowerShellGallery/PsLANDesk/1.13/Functions/Get-LANDeskMachineData.ps1 | Get-LANDeskMachineData.ps1 | Function Get-LANDeskMachineData
{
<#
.SYNOPSIS
Retrieves more detailed information about the computer specified by the GUID parameter from the LANDeskWebService object.
.DESCRIPTION
Retrieves more detailed information about the computer specified by the GUID parameter.
.PARAMETER GUID
T... |
PowerShellCorpus/PowerShellGallery/PsLANDesk/1.13/Functions/Get-LANDeskAgentBehaviors.ps1 | Get-LANDeskAgentBehaviors.ps1 | Function Get-LANDeskAgentBehaviors
{
<#
.SYNOPSIS
Returns all of the agent behaviors on the connected LANDesk webservice. AgentBehavior Id number is used as input for scheduling patches
.DESCRIPTION
Returns all of the agent behaviors on the connected LANDesk webservice. Uses the GetAgentBehaviors ... |
PowerShellCorpus/PowerShellGallery/PsLANDesk/1.13/Functions/Connect-LANDeskServer.ps1 | Connect-LANDeskServer.ps1 | Function Connect-LANDeskServer
{
<#
.SYNOPSIS
Connects to the webservice of inputted LANDesk server.
.DESCRIPTION
Connects to the webservice of inputted LANDesk server. Creates a global variable named $LANDeskWebService for use in the PSLANDesk Module.
.PARAMETER LANDeskServer
The name ... |
PowerShellCorpus/PowerShellGallery/PsLANDesk/1.13/Functions/Get-LANDeskComputer.ps1 | Get-LANDeskComputer.ps1 | Function Get-LANDeskComputer
{
<#
.SYNOPSIS
The Get-LANDeskComputer function creates the gloabl variable $LANDeskComputers if it doesn't yet exist. This is all of the computers returned by the ListMachines
method of the LANDesk Web Service object. The function then return output based on whether the Filt... |
PowerShellCorpus/PowerShellGallery/PsLANDesk/1.13/Functions/Remove-LANDeskComputerFromScheduledTask.ps1 | Remove-LANDeskComputerFromScheduledTask.ps1 | Function Remove-LANDeskComputerFromScheduledTask
{
<#
.SYNOPSIS
The Remove-LANDeskComputerFromScheduledTask function removes the specified computer from the specified LANDesk task.
.DESCRIPTION
The Remove-LANDeskComputerFromScheduledTask function removes the specified computer from the specified ... |
PowerShellCorpus/PowerShellGallery/PsLANDesk/1.13/Functions/Start-LANDeskTask.ps1 | Start-LANDeskTask.ps1 | Function Start-LANDeskTask
{
<#
.SYNOPSIS
The Start-LANDeskTask function starts the specified LANDesk Scheduled Task.
.DESCRIPTION
The Start-LANDeskTask function starts the specified LANDesk Scheduled Task and returns the results using the Webservice object.
.PARAMETER ID
The Task ID of... |
PowerShellCorpus/PowerShellGallery/PsLANDesk/1.13/Functions/Get-LANDeskDistributionPackage.ps1 | Get-LANDeskDistributionPackage.ps1 | Function Get-LANDeskDistributionPackage
{
<#
.SYNOPSIS
The Get-LANDeskDistributionPackage function returns a list of Distribution packages on the LANDesk Core Server.
.DESCRIPTION
The Get-LANDeskDistributionPackage function returns a list of Distribution packages on the LANDesk Core Server.
... |
PowerShellCorpus/PowerShellGallery/PsLANDesk/1.13/Functions/Get-LANDeskTaskStatus.ps1 | Get-LANDeskTaskStatus.ps1 | Function Get-LANDeskTaskStatus
{
<#
.SYNOPSIS
The Get-LANDeskTaskStatus function returns the status of the specified LANDesk task.
.DESCRIPTION
The Get-LANDeskTaskStatus function returns the status of the specified LANDesk task. Requires the ID number of the task to check which can be found by ri... |
PowerShellCorpus/PowerShellGallery/PsLANDesk/1.13/Functions/Add-LANDeskComputerToScheduledTask.ps1 | Add-LANDeskComputerToScheduledTask.ps1 | Function Add-LANDeskComputerToScheduledTask
{
<#
.SYNOPSIS
The Add-LANDeskComputerToScheduledTask function adds the specified computer to the specified LANDesk task.
.DESCRIPTION
The Add-LANDeskComputerToScheduledTask function adds the specified computer to the specified LANDesk task. Requires th... |
PowerShellCorpus/PowerShellGallery/PsLANDesk/1.13/Functions/Remove-LANDeskComputer.ps1 | Remove-LANDeskComputer.ps1 | Function Remove-LANDeskComputer
{
<#
.SYNOPSIS
Removes specified computer from LANDesk.
.DESCRIPTION
Removes specified computer from LANDesk.
.PARAMETER ComputerName
The name or names of the computers to remove from the LANDesk database.
.EXAMPLE
Remove-LANDeskComputer <Compu... |
PowerShellCorpus/PowerShellGallery/PowerCLITools/1.0.1/PowerCLITools.Initialise.ps1 | PowerCLITools.Initialise.ps1 | # --- Check for IE Publisher Certificate Revocation and disable if necessary.
# --- Speeds up PowerCLI startup, see http://blogs.vmware.com/vipowershell/2010/01/troubleshooting-slow-startup-with-powercli-40-u1.html
$CertificateRevocation = (Get-ItemProperty -Path "HKCU:Software\Microsoft\Windows\CurrentVersion\WinTru... |
PowerShellCorpus/PowerShellGallery/PowerCLITools/1.0.1/PowerCLITools.Global.ps1 | PowerCLITools.Global.ps1 | function Connect-vCenter {
<#
.SYNOPSIS
Connect to a vSphere vCenter.
.DESCRIPTION
Connect to a vSphere vCenter.
.PARAMETER Server
vCenter name.
.PARAMETER Username
User account to connect to vCenter with.
.PARAMETER Password
Password for user account to connect to vCenter with.
... |
PowerShellCorpus/PowerShellGallery/PowerUpSQL/1.0.0.76/PowerUpSQL.ps1 | PowerUpSQL.ps1 | #requires -version 2
<#
File: PowerUpSQL.ps1
Author: Scott Sutherland (@_nullbind), NetSPI - 2016
Major Contributors: Antti Rantasaari and Eric Gruber
Version: 1.0.0.76
Description: PowerUpSQL is a PowerShell toolkit for attacking SQL Server.
License: BSD 3-Clause
... |
PowerShellCorpus/PowerShellGallery/SQLAutoRestores/0.9.1.0/Example.ps1 | Example.ps1 | <#
This is the rough plan for how this will work.
Subject to change as I split apart the script this started off as, and as I try to build in testing
#>
Import-Module .\SQLAutoRestores.psm1
#GEt connection to SQL Server we're going to restore onto
$SQLconnection = New-SQLConnection 'server1\instance2'
... |
PowerShellCorpus/PowerShellGallery/SQLAutoRestores/0.9.1.0/Functions/function-Test-RestoreSpace.ps1 | function-Test-RestoreSpace.ps1 | function Test-RestoreSpace
{
<#
.SYNOPSIS
Given a set of files to restore, check there's enough space on the target system
.DESCRIPTION
GO through set of SQL Server backup files and calculate the maximum space needed to perform the requested restore, and then check that the specified server has the r... |
PowerShellCorpus/PowerShellGallery/SQLAutoRestores/0.9.1.0/Functions/function-Get-RestoreSet.ps1 | function-Get-RestoreSet.ps1 | function Get-RestoreSet
{ <#
.SYNOPSIS
Pick a random point in time to restore a SQL backup to
.DESCRIPTION
Take a BackupsObject, calculate the time period over which it could be restored. Find a random point in that time,
and then build up the required files to restore to that point
.EXAMPLE
... |
PowerShellCorpus/PowerShellGallery/SQLAutoRestores/0.9.1.0/Functions/function-Restore-SQLBackupHeader.ps1 | function-Restore-SQLBackupHeader.ps1 | function Restore-SQLBackupHeader
{
<#
.SYNOPSIS
Restore a SQL Backup for only it's headers
.DESCRIPTION
PUll the headers from a SQL Server backup file to get information on it's contents. Works with Full, Diff and Transaction log backups.
.EXAMPLE
Restore-SQLBackupHeaders -RestoreServer
... |
PowerShellCorpus/PowerShellGallery/SQLAutoRestores/0.9.1.0/Functions/function-Get-RandomElement.ps1 | function-Get-RandomElement.ps1 | function Get-RandomElement
{
<#
.SYNOPSIS
Takes an arraylist of strings, and returns a random element.
.DESCRIPTION
Given an array, function returns a random element within that array
.EXAMPLE
Get-RandomElement -InputArray $Arraylist
.PARAMETER InputArray
ArrayList to work with
... |
PowerShellCorpus/PowerShellGallery/SQLAutoRestores/0.9.1.0/Functions/function-Get-RandomElement.Tests.ps1 | function-Get-RandomElement.Tests.ps1 | $here = Split-Path -Parent System.Management.Automation.InvocationInfo.MyCommand.Path
Get-Module SQLAutoRestores | Remove-Module -Force
Import-Module ..\SQLAutoRestores -Force
Describe 'Get-RandomElement Unit Tests' -tags 'Unit' {
InModuleScope SQLAutoRestores {
Context "Single item Array" {
... |
PowerShellCorpus/PowerShellGallery/SQLAutoRestores/0.9.1.0/Functions/function-Get-BottomFolders.ps1 | function-Get-BottomFolders.ps1 | function Get-BottomFolders
{
<#
.SYNOPSIS
Get the folders at the bottom of directory tree starting at $InputPath, returns an Arraylist of all the bottom folder
.DESCRIPTION
Given a folder, find all the lowest folders across all branches
.EXAMPLE
Get-BottomFolder -RootPath '\\server1\dbbackups$'... |
PowerShellCorpus/PowerShellGallery/SQLAutoRestores/0.9.1.0/Functions/function-Get-FileRestoreMove.ps1 | function-Get-FileRestoreMove.ps1 | function Get-FileRestoreMove
{
<#
.SYNOPSIS
Given a set of files to restore, generates the necessary RelocateFiles object for the given path
.DESCRIPTION
Function to generate the SQL restore syntax to move all the data and log files in a SQL Server backup to a new destination during restore
.EXAMP... |
PowerShellCorpus/PowerShellGallery/SQLAutoRestores/0.9.1.0/Functions/function-Test-Database.ps1 | function-Test-Database.ps1 | function Test-Database
{
<#
.SYNOPSIS
Run a DBCC check
.DESCRIPTION
Run a DBCC CHECKDB against a specified database on a specified SQL Server instance.
If all is OK, returns True, or returns messages if set to Verbose
Returns False and all errors if there's a problem
.EXAMPLE
Tes... |
PowerShellCorpus/PowerShellGallery/SQLAutoRestores/0.9.1.0/Functions/function-Test-DatabaseVersion.ps1 | function-Test-DatabaseVersion.ps1 | function Test-DatabaseVersion
{
<#
.SYNOPSIS
Check db is a version that can be restored
.DESCRIPTION
Given a set of files to restore, checks they can be restored on the specified SQL Server version
Basic check of not being able to restore backups from more than 2 Major Versions before.
.EXAMP... |
PowerShellCorpus/PowerShellGallery/SQLAutoRestores/0.9.1.0/Functions/function-Test-DatabaseExists.ps1 | function-Test-DatabaseExists.ps1 | function Test-DatabaseExists
{
<#
.SYNOPSIS
Checks if a database exists on a specified sql instance
.DESCRIPTION
Check to see if a database exists before restoring a database to make sure we don't clobber anything important.
Also checks for system databases (master, model, msdb, temp)
.EXAMPL... |
PowerShellCorpus/PowerShellGallery/SQLAutoRestores/0.9.1.0/Functions/function-Get-PointInTime.ps1 | function-Get-PointInTime.ps1 | function Get-PointInTime
{
<#
.SYNOPSIS
Get a point in time covered by a set of SQL backups
.DESCRIPTION
Find a point in time to which a SQL Server database can be restore given a set of backup files
.EXAMPLE
Get-PointInTime -BackupObjects $BackupObjects
.PARAMETER BackupObjects
A co... |
PowerShellCorpus/PowerShellGallery/SQLAutoRestores/0.9.1.0/Functions/function-New-SQLConnection.ps1 | function-New-SQLConnection.ps1 | function New-SQLConnection
{
<#
.SYNOPSIS
get an SMO connection object
.DESCRIPTION
Given an Instance Name returns an SMO connection object for that SQL Server Instance
.EXAMPLE
New-SQLConnection -ServerInstance 'computer1\Instance2'
.PARAMETER ServerInstance
SQL Server Instance to ... |
PowerShellCorpus/PowerShellGallery/SQLAutoRestores/0.9.1.0/Functions/function-Remove-Database.ps1 | function-Remove-Database.ps1 | function Remove-Database
{
<#
.SYNOPSIS
Drop a specified database on a SQL Server instance
.DESCRIPTION
Drops a database once it's been finished with
.EXAMPLE
Remove-Database -RestoreSQLServer $sqlsvr -DatabaseName 'DBToDrop'
.PARAMETER RestoreSQLSever
An SMO SQL Server Connection obj... |
PowerShellCorpus/PowerShellGallery/SQLAutoRestores/0.9.1.0/Functions/function-Test-DBBackupsExist.ps1 | function-Test-DBBackupsExist.ps1 | function Test-DBBackupsExist {
<#
.SYNOPSIS
Basic check that we have SQL Backup files in a folder
.DESCRIPTION
Passed a folder location performs a basic checkt that we have some files that may make up a SQL Server backup chain. That means at least 1 bak file to anchor it
Return $true if they exi... |
PowerShellCorpus/PowerShellGallery/SQLAutoRestores/0.9.1.0/Functions/function-Get-DBBackupObject.ps1 | function-Get-DBBackupObject.ps1 | function Get-DBBackupObject
{
<#
.SYNOPSIS
Given a folder, scans for all SQL Server backup files (bak, trn, etc) and returns an object giving abridged details of each backup
.DESCRIPTION
A wrapper function around RESTORE FILELISTONLY and RESTORE HEADERONLY to pull back information contained with SQL ... |
PowerShellCorpus/PowerShellGallery/SQLAutoRestores/0.9.1.0/Functions/function-New-BackupObject.ps1 | function-New-BackupObject.ps1 | function New-BackupObject
{
<#
.SYNOPSIS
Returns a new BackupObject
.DESCRIPTION
Creates an object with the properties required for a BackupObject to carry the necessary information between parts of the Automated Restore Process.
Mainly here because not everyone will want to install CTYPE or upg... |
PowerShellCorpus/PowerShellGallery/SQLAutoRestores/0.9.1.0/Functions/function-Restore-Database.ps1 | function-Restore-Database.ps1 | function Restore-Database
{
<#
.SYNOPSIS
Restores a set of SQL backup files
.DESCRIPTION
Given a set of SQL Server backup files restores the files up to the specified point in time, or completely if not specified. Can also generate the restore scripts for the actions.
.EXAMPLE
Restore-Databa... |
PowerShellCorpus/PowerShellGallery/SQLAutoRestores/0.9.1.0/Functions/function-Test-BackupObject.ps1 | function-Test-BackupObject.ps1 | function Test-BackupObject
{
<#
.SYNOPSIS
Check an Object is of type BackupOpbject
.DESCRIPTION
Check an Object is of type BackupOpbject. returns $true if it is, $false if not
.EXAMPLE
Test-BackupObject -BackupObject $BackupObject
.Example
$BackupObject | Test-BackupObject
.Exam... |
PowerShellCorpus/PowerShellGallery/AzureRM.OperationalInsights/3.1.0/OperationalInsightsStartup.ps1 | OperationalInsightsStartup.ps1 | # ----------------------------------------------------------------------------------
#
# Copyright Microsoft Corporation
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apach... |
PowerShellCorpus/PowerShellGallery/AzureRM.OperationalInsights/2.8.0/OperationalInsightsStartup.ps1 | OperationalInsightsStartup.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/PSPushover/1.0.6/Private/Import-PushoverConfig.ps1 | Import-PushoverConfig.ps1 | Function Import-PushoverConfig {
<#
.Synopsis
Check for configuration and output the information.
.DESCRIPTION
Check for configuration and output the information. Goes into the $env:appdata for the configuration file.
.EXAMPLE
ImportConfig
#>
if (Test-Path $ConfigPath) {
Import-Clixml $C... |
PowerShellCorpus/PowerShellGallery/PSPushover/1.0.6/Public/Get-PushoverUserDevice.ps1 | Get-PushoverUserDevice.ps1 | Function Get-PushoverUserDevice {
<#
.SYNOPSIS
Retrieves a list of registered devices with Pushover.
.DESCRIPTION
Retrieves a list of registered devices with Pushover. Useful for trying to gather all of the possible devices to send to.
.EXAMPLE
Get-PushoverUserDevices
Nexus7
Blackfyre
#>
... |
PowerShellCorpus/PowerShellGallery/PSPushover/1.0.6/Public/Save-PushoverAPIInformation.ps1 | Save-PushoverAPIInformation.ps1 | $ConfigPath = "$env:appdata\PSPushover\PSPushoverConfiguration.xml"
Function Save-PushoverAPIInformation {
<#
.SYNOPSIS
Used to save a configuration file used for PushOver alerts.
.DESCRIPTION
Used to save a configuration file used for PushOver alerts. It stores the file in the AppData folder
in XML format.
... |
PowerShellCorpus/PowerShellGallery/PSPushover/1.0.6/Public/Send-PushoverMessage.ps1 | Send-PushoverMessage.ps1 | Function Send-PushoverMessage {
<#
.SYNOPSIS
Actually sends message off to Pushover Devices
.DESCRIPTION
Uses the Pushover API to send messages via powershell. Requires Save-PushoverAPIInformation first.
Devices are auto populated from the list of registered devices with Pushover. Also saves the message... |
PowerShellCorpus/PowerShellGallery/vmxtoolkit/4.1/vmxtoolkitinit.ps1 | vmxtoolkitinit.ps1 | [CmdletBinding()]
param
(
$VMX_Path)
################## Some Globals
write-Host "trying to get os type ... "
if (Test-Path C:\WINDOWS\system32\ntdll.dll)
{
$OS_Version = Get-Command C:\WINDOWS\system32\ntdll.dll
$OS_Version = "Product Name: Windows $($OS.Version)"
$Global:vmxtoolkit_type ="win_x86_64"... |
PowerShellCorpus/PowerShellGallery/AppxGet/0.1.0.1/Private/Find-AppxPackage.ps1 | Find-AppxPackage.ps1 | function Find-AppxPackage {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]
$PackageFullName
)
process {
Get-AppxPackage | Where-Object { $_.PackageFullName -eq $PackageFullName }
}
}
|
PowerShellCorpus/PowerShellGallery/AppxGet/0.1.0.1/Private/Get-AppxPackageSoftwareIdentity.ps1 | Get-AppxPackageSoftwareIdentity.ps1 | function Get-AppxPackageSoftwareIdentity {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true, Position = 1, ValueFromPipeline = $true)]
[object]
$AppxPackage,
[Parameter(Mandatory = $false)]
[string]
$RequiredVersion,
[Parameter(Mandatory... |
PowerShellCorpus/PowerShellGallery/AppxGet/0.1.0.1/Private/Test-Version.ps1 | Test-Version.ps1 | # Check whether $version meets the criteria defined in $RequiredVersion, $MinimumVersion and $MaximumVersion
function Test-Version {
[CmdletBinding()]
[OutputType([bool])]
param (
[Parameter(Mandatory=$true)]
[ValidateNotNull()]
$Version,
[Parameter()]
[str... |
PowerShellCorpus/PowerShellGallery/AppxGet/0.1.0.1/Provider/Initialize-Provider.ps1 | Initialize-Provider.ps1 | function Initialize-Provider {
Write-Debug "Initialize-Provider"
}
|
PowerShellCorpus/PowerShellGallery/AppxGet/0.1.0.1/Provider/Context.ps1 | Context.ps1 | $script:ProviderName = "AppX"
$script:PackageSource = "WindowsStore"
|
PowerShellCorpus/PowerShellGallery/AppxGet/0.1.0.1/Provider/Get-PackageProviderName.ps1 | Get-PackageProviderName.ps1 | function Get-PackageProviderName {
return $script:ProviderName
}
|
PowerShellCorpus/PowerShellGallery/AppxGet/0.1.0.1/Provider/Uninstall-Package.ps1 | Uninstall-Package.ps1 | # See https://technet.microsoft.com/en-us/itpro/powershell/windows/appx/remove-appxpackage
function Uninstall-Package {
[CmdletBinding()]
param (
[Parameter(Mandatory = $true)]
[ValidateNotNullOrEmpty()]
[string]
$FastPackageReference
)
process {
[Micros... |
PowerShellCorpus/PowerShellGallery/AppxGet/0.1.0.1/Provider/Get-InstalledPackage.ps1 | Get-InstalledPackage.ps1 | # See https://technet.microsoft.com/itpro/powershell/windows/appx/get-appxpackage
function Get-InstalledPackage {
[CmdletBinding()]
param (
[Parameter()]
[string]
$Name,
[Parameter()]
[string]
$RequiredVersion,
[Parameter()]
[string]... |
PowerShellCorpus/PowerShellGallery/AppxGet/0.1.0.1/Provider/Get-DynamicOptions.ps1 | Get-DynamicOptions.ps1 | # Defines PowerShell dynamic parameters so that a user can pass in parameters via OneGet to the provider
function Get-DynamicOptions {
[CmdletBinding()]
param (
# See https://github.com/OneGet/oneget/wiki/OptionCategory
[Microsoft.PackageManagement.MetaProvider.PowerShell.OptionCategory]
... |
PowerShellCorpus/PowerShellGallery/Subversion/1.2.2/Repair-SvnWorkingCopy.ps1 | Repair-SvnWorkingCopy.ps1 | <#
.SYNOPSIS
Fix a working copy that has been modified by non-svn commands in terms of
adding and removing files.
.DESCRIPTION
Identify items that are not under version control and items that are missing
(i.e. removed by non-svn command). Put non-versioned items under version
control (i.e. schedule for ... |
PowerShellCorpus/PowerShellGallery/Subversion/1.2.2/Get-SvnWorkingCopy.ps1 | Get-SvnWorkingCopy.ps1 | <#
.SYNOPSIS
Wrapper function for "svn.exe status"
.DESCRIPTION
Get the status of working copy files and directories.
.EXAMPLE
Get-SvnWorkingCopy -Path .\myProject
#>
function Get-SvnWorkingCopy
{
[CmdletBinding()]
Param (
# Identifies the directory of the working copy.
[... |
PowerShellCorpus/PowerShellGallery/Subversion/1.2.2/Add-SvnWorkingCopyItem.ps1 | Add-SvnWorkingCopyItem.ps1 | <#
.SYNOPSIS
Wrapper function for "svn.exe add"
.DESCRIPTION
Put files and directories under version control, scheduling them for addition
to repository in next commit.
.EXAMPLE
Add-SvnWorkingCopyItem -Path .\myProject\final.txt
#>
function Add-SvnWorkingCopyItem
{
[CmdletBinding(SupportsShou... |
PowerShellCorpus/PowerShellGallery/Subversion/1.2.2/Update-SvnWorkingCopy.ps1 | Update-SvnWorkingCopy.ps1 | <#
.SYNOPSIS
Wrapper function for "svn.exe update"
.DESCRIPTION
Bring the latest changes from the repository into the working copy (HEAD revision).
.EXAMPLE
Update-SvnWorkingCopy -Path .\myProject
#>
function Update-SvnWorkingCopy
{
[CmdletBinding(SupportsShouldProcess=$true)]
Param (
... |
PowerShellCorpus/PowerShellGallery/Subversion/1.2.2/New-SvnWorkingCopy.ps1 | New-SvnWorkingCopy.ps1 | <#
.SYNOPSIS
Wrapper function for "svn.exe checkout"
.DESCRIPTION
Check out a working copy from a repository (HEAD revision).
.EXAMPLE
New-SvnWorkingCopy -Url https://myserver/svn/myrepo -Path .\myProject
#>
function New-SvnWorkingCopy
{
[CmdletBinding(SupportsShouldProcess=$true)]
Param (... |
PowerShellCorpus/PowerShellGallery/Subversion/1.2.2/Switch-SvnWorkingCopy.ps1 | Switch-SvnWorkingCopy.ps1 | <#
.SYNOPSIS
Wrapper function for "svn.exe switch"
.DESCRIPTION
Update the working copy to a different URL within the same repository.
.EXAMPLE
Switch-SvnWorkingCopy -Url https://myserver/svn/myrepo
#>
function Switch-SvnWorkingCopy
{
[CmdletBinding()]
Param (
# Identifies the new... |
PowerShellCorpus/PowerShellGallery/Subversion/1.2.2/Import-SvnUnversionedFilePath.ps1 | Import-SvnUnversionedFilePath.ps1 | <#
.SYNOPSIS
Wrapper function for "svn.exe import"
.DESCRIPTION
Commit an unversioned file or directory tree into the repository.
.EXAMPLE
Import-SvnUnversionedFilePath -Path .\myProject -Url https://myserver/svn/myrepo
#>
function Import-SvnUnversionedFilePath
{
[CmdletBinding(SupportsShouldPr... |
PowerShellCorpus/PowerShellGallery/Subversion/1.2.2/Remove-SvnWorkingCopyItem.ps1 | Remove-SvnWorkingCopyItem.ps1 | <#
.SYNOPSIS
Wrapper function for "svn.exe delete"
.DESCRIPTION
Remove files and directories from version control. Each item specified by Path
is scheduled for deletion upon the next commit. Items that have not been
committed, are immediately removed from the working copy.
.EXAMPLE
Remove-SvnWorkingC... |
PowerShellCorpus/PowerShellGallery/Subversion/1.2.2/Publish-SvnWorkingCopy.ps1 | Publish-SvnWorkingCopy.ps1 | <#
.SYNOPSIS
Wrapper function for "svn.exe commit"
.DESCRIPTION
Send changes from your working copy to the repository.
.EXAMPLE
Publish-SvnWorkingCopy -Path .\myProject -Message 'Fixed bug #456'
#>
function Publish-SvnWorkingCopy
{
[CmdletBinding(SupportsShouldProcess=$true)]
Param (
... |
PowerShellCorpus/PowerShellGallery/xOU/1.0/Examples/xOUSample.ps1 | xOUSample.ps1 | # Requires a certificate to have been set up that can be used to encrypt and decrypt credentials.
Param(
[Parameter(Position=0, Mandatory=$True, HelpMessage='Specify the NodeName for the install e.g. TESTSVR01')]
[String] $NodeName
)
# Get the certificate that will be used to encrypt and decrypt credentials.
#... |
PowerShellCorpus/PowerShellGallery/xOU/1.0/IntegrationTests/MSFT_xADOrganizationalUnit_IntegrationTests.ps1 | MSFT_xADOrganizationalUnit_IntegrationTests.ps1 | $script:domainDn = (Get-ADDomain).DistinguishedName
$script:testOuName = "testou"
$script:testOuDescription = "description"
$script:testOuSecondDescription = "second description"
$script:credential = New-Object System.Management.Automation.PSCredential("$domainName\Administrator", (ConvertTo-SecureString "Passw0rd1... |
PowerShellCorpus/PowerShellGallery/PSAppInsights/0.9.6/get-NugetPackages.ps1 | get-NugetPackages.ps1 | #Assumes current folder to be the location where the packages are to be installed
#Make sure to update Nuget
.\nuget.exe update -self
#Now install the packages as specified
.\nuget.exe install .\packages.config -o .
|
PowerShellCorpus/PowerShellGallery/PSAppInsights/0.9.6/install-NugetPackages.ps1 | install-NugetPackages.ps1 | cd .\PSAppInsights
#Make sure to update Nuget
.\nuget.exe update -self
#Now install the packages as specified in ther packages.config file
.\nuget.exe install .\packages.config -o .
|
PowerShellCorpus/PowerShellGallery/PSAppInsights/0.9.6/Sample/advanced tracing.ps1 | advanced tracing.ps1 | <#
# Sample of helper functions and extended tracing
#>
# The ConvertTo-Hashtable cmdlet converts an object's properties to a hashtable
# the contents of such a hashtable can be attached to an event or trace using -properties $hashtable
# in order to log that information to AppInsights
#send information f... |
PowerShellCorpus/PowerShellGallery/PSAppInsights/0.9.6/Sample/CreateReleaseAnnotation.ps1 | CreateReleaseAnnotation.ps1 | # Sample usage .\CreateReleaseAnnotation.ps1 -applicationId "<appId>" -apiKey "<apiKey>" -releaseName "<releaseName>" -releaseProperties @{"ReleaseDescription"="Release with annotation";"TriggerBy"="John Doe"} -eventDateTime "2016-07-07T06:23:44"
#Requires -version 3
#Suppress warning for select
[Diagnostics.... |
PowerShellCorpus/PowerShellGallery/PSAppInsights/0.9.6/Sample/Live Metrics.ps1 | Live Metrics.ps1 | <#
.Synopsis
Starts logging a live metrics stream to App Insights
.DESCRIPTION
The logging stream sends a standard set of perfcounters every second, which allows you to monitor essential counters directly in AppInsights.
Please note that this will incur a continous stream of performance and stati... |
PowerShellCorpus/PowerShellGallery/PSAppInsights/0.9.6/Sample/LogExceptions.ps1 | LogExceptions.ps1 | <#
# Demonstration of the Exeption Logging capabilities of Application Insights
#>
#Import the module
Import-Module .\PSAppInsights.psd1 -Force
$key = "b437832d-a6b3-4bb4-b237-51308509747d"
#init a client and send basic non-PII information for correlation
#this includes identifiers hashed(username) and ... |
PowerShellCorpus/PowerShellGallery/PSAppInsights/0.9.6/Sample/Call CreateReleaseAnnotation.ps1 | Call CreateReleaseAnnotation.ps1 |
#$iKey = 'b437832d-a6b3-4bb4-b237-51308509747d' #AI PowerShell
$AppID = '22a37615-a433-4b2e-89e7-d3b924f57a6a' #Can this be looked up ?
$APIKey = 'ux8ab05zo1s0wksvjitc67ksyswcxj1pywria7i4'
. .\CreateReleaseAnnotation.ps1
#Default
CreateReleaseAnnotation -Verbose -applicationId $AppID... |
PowerShellCorpus/PowerShellGallery/PSAppInsights/0.9.6/Sample/Basic Use.ps1 | Basic Use.ps1 | <#
# Demonstration of the basic capabilities of Application Insights
#>
#Import the module
Import-Module .\PSAppInsights.psd1 -Force
$key = "b437832d-a6b3-4bb4-b237-51308509747d"
#init a client and send basic non-PII information for correlation
#this includes identifiers hashed(username) and hashed(mach... |
PowerShellCorpus/PowerShellGallery/PSAppInsights/0.9.6/Sample/Simple AI withouth module.ps1 | Simple AI withouth module.ps1 | $iKey = 'b437832d-a6b3-4bb4-b237-51308509747d'
<#
$body = (New-Object PSObject `
| Add-Member -PassThru NoteProperty name 'Microsoft.ApplicationInsights.Event' `
| Add-Member -PassThru NoteProperty time $([System.dateTime]::UtcNow.ToString('o')) `
| Add-Member -PassThru NoteProperty iKey $iKey `
... |
PowerShellCorpus/PowerShellGallery/PSAppInsights/0.9.6/Sample/PerformanceCounters.ps1 | PerformanceCounters.ps1 | <#
.Synopsis
Start collection perfromance counters and send them to App Insights
The collection includes perf counters of the powershell process tha runs the script.
By default the following perf counters are collected :
- Handle Count
- Working Set
If other process counters a... |
PowerShellCorpus/PowerShellGallery/DogStatsD/0.0.1.0/DogStatsD.sandbox.ps1 | DogStatsD.sandbox.ps1 | Remove-Module DogStatsD -Force -ErrorAction SilentlyContinue
Import-Module $PSScriptRoot
Set-Location $PSScriptRoot
|
PowerShellCorpus/PowerShellGallery/DogStatsD/0.0.1.0/Functions/Send-DataDogEvent.ps1 | Send-DataDogEvent.ps1 |
<#
.SYNOPSIS
Sends an event to DataDog
.DESCRIPTION
PowerShell cmdlet to send events to DataDog via DogStatsD
UDP datagram. Format as per described at:
- http://docs.datadoghq.com/guides/dogstatsd/#events-1
.PARAMETER Title
Mandatory Title of the Event
.PARAMETER Text
Optional Eve... |
PowerShellCorpus/PowerShellGallery/DogStatsD/0.0.1.0/Functions/Common.ps1 | Common.ps1 | Set-Alias -Name 'Send-DataDogStatsD' -Value 'Send-StatsD' -Scope Script
Set-Alias -Name 'Send-DogStatsD' -Value 'Send-StatsD' -Scope Script
|
PowerShellCorpus/PowerShellGallery/DogStatsD/0.0.1.0/Functions/Send-StatsD.ps1 | Send-StatsD.ps1 | <#
.SYNOPSIS
Sends data to a statsd UDP service endpoint
.DESCRIPTION
PowerShell function to send UDP data to a statsd endpoint,
like DogStatsD service in a ASCII encoded byte-format.
The function supports the basic -Verbose and -Debug
cmdletbindings.
.PARAMETER Data
Mandatory - Strin... |
PowerShellCorpus/PowerShellGallery/DogStatsD/0.0.1.0/Functions/Send-DataDogMetric.ps1 | Send-DataDogMetric.ps1 | <#
.SYNOPSIS
Sends a metric value to DataDog
.DESCRIPTION
PowerShell cmdlet to send a metric value to DogStatsD
in a DataDog specific format as per described at:
- http://docs.datadoghq.com/guides/dogstatsd/#metrics-1
.PARAMETER Name
Mandatory Name of the metric
.PARAMETER Value
Man... |
PowerShellCorpus/PowerShellGallery/DogStatsD/0.0.1.0/Tests/TestCommon.ps1 | TestCommon.ps1 | # Load module from the local filesystem, instead from the ModulePath
Remove-Module DogStatsD -Force -ErrorAction SilentlyContinue
Import-Module (Split-Path $PSScriptRoot -Parent)
$Script:ModuleName = 'DogStatsD'
$script:FunctionPath = Resolve-Path (Join-Path $PSScriptRoot '../Functions')
|
PowerShellCorpus/PowerShellGallery/DogStatsD/0.0.1.0/Tests/Module/ScriptAnalyzer.tests.ps1 | ScriptAnalyzer.tests.ps1 | . (Join-Path $PSScriptRoot '../TestCommon.ps1')
$scriptSources = Get-ChildItem -Path $script:FunctionPath -Filter '*.ps1' -Recurse
$excludeRuleList = @(
'PSUseShouldProcessForStateChangingFunctions'
)
if (-Not (Get-Module PSScriptAnalyzer -ListAvailable)) {
try {
Write-Verbose "Trying to inst... |
PowerShellCorpus/PowerShellGallery/DogStatsD/0.0.1.0/Tests/Module/Module.tests.ps1 | Module.tests.ps1 | . (Join-Path $PSScriptRoot '../TestCommon.ps1')
$exportedCommands = (Get-Command -Module $Script:ModuleName)
$expectedCommands = Import-Csv -Path (Join-Path $PSScriptRoot 'expected_commands.csv')
Describe "$($Script:ModuleName) Module" {
It "ModuleName Should be set" {
$Script:ModuleName | Should N... |
PowerShellCorpus/PowerShellGallery/ScriptConfig/2.0.0/Functions/Get-ScriptConfig.ps1 | Get-ScriptConfig.ps1 | <#
.SYNOPSIS
Load a script configuration from a config file.
.DESCRIPTION
Load a script configuration from a config file. By default, the config file
next to the script is loaded. So for the script MyScript.ps1, the config
file MyScript.ps1.config will be loaded. The config file format will be
... |
PowerShellCorpus/PowerShellGallery/ScriptConfig/2.0.0/Helpers/ConvertFrom-ScriptConfigJson.ps1 | ConvertFrom-ScriptConfigJson.ps1 | <#
.SYNOPSIS
Convert the JSON file content to a hashtable containing the configuration.
.EXAMPLE
PS C:\> Get-Content -Path 'config.json' | ConvertFrom-ScriptConfigJson
Use the pipeline input to parse the JSON file content.
.NOTES
Author : Claudio Spizzi
License : MIT License
... |
PowerShellCorpus/PowerShellGallery/ScriptConfig/2.0.0/Helpers/ConvertFrom-ScriptConfigXml.ps1 | ConvertFrom-ScriptConfigXml.ps1 | <#
.SYNOPSIS
Convert the XML file content to a hashtable containing the configuration.
.EXAMPLE
PS C:\> Get-Content -Path 'config.xml' | ConvertFrom-ScriptConfigXml
Use the pipeline input to parse the XML file content.
.NOTES
Author : Claudio Spizzi
License : MIT License
.L... |
PowerShellCorpus/PowerShellGallery/ScriptConfig/2.0.0/Helpers/ConvertFrom-ScriptConfigIni.ps1 | ConvertFrom-ScriptConfigIni.ps1 | <#
.SYNOPSIS
Convert the INI file content to a hashtable containing the configuration.
.EXAMPLE
PS C:\> Get-Content -Path 'config.ini' | ConvertFrom-ScriptConfigIni
Use the pipeline input to parse the INI file content.
.NOTES
Author : Claudio Spizzi
License : MIT License
.L... |
PowerShellCorpus/PowerShellGallery/MrAAppx/0.3/Get-AppxProtocol.ps1 | Get-AppxProtocol.ps1 | <#
.Synopsis
Get the protocol used by Windows Store (UWP) Apps installed on the local system.
.DESCRIPTION
Windows Store Apps, also known as Universal Windows Platform apps (UWP), register
protocols when they are installed on Windows via AppX packages.
The protocol(s) of the app can be used to launch ... |
PowerShellCorpus/PowerShellGallery/MrAAppx/0.3/New-AppxShortcut.ps1 | New-AppxShortcut.ps1 | <#
.Synopsis
Create shortcuts for UWP Apps-based upon the app's protocol(s).
.DESCRIPTION
Create shortcuts for UWP Apps-based upon the app's protocol(s). These
shortcuts could be used by application launcher's such as Launchy so that
you can start UWP apps.
.NOTES
Created by: Jason Wasser @wasser... |
PowerShellCorpus/PowerShellGallery/newrelic/0.0.5/Private/Format-NRDate.ps1 | Format-NRDate.ps1 | function Format-NRDate {
<#
.SYNOPSIS
Returns a string with the specified date for NewRelic API
.DESCRIPTION
Returns a string with the specified date (defaults to current datetime) for NewRelic API calls.
This is usually passed to Format-NRTimeSpan as a start or end time.
.EXAMPL... |
PowerShellCorpus/PowerShellGallery/newrelic/0.0.5/Public/Get-NRTimeSpan.ps1 | Get-NRTimeSpan.ps1 | function Get-NRTimeSpan {
<#
.SYNOPSIS
Builds a timespan string for NewRelic API calls
.DESCRIPTION
Builds a timespan string for NewRelic API calls
.EXAMPLE
$Start = (Get-Date).AddDays(-1)
$End = Get-Date
Get-NRTimeSpan -Start $Start -End $End
from=2017-... |
PowerShellCorpus/PowerShellGallery/newrelic/0.0.5/Public/Get-NRApplication.ps1 | Get-NRApplication.ps1 | function Get-NRApplication {
<#
.SYNOPSIS
Builds up and submits a web request to the New Relic API.
.DESCRIPTION
Will build a properly structured web request to use for the New Relic API. This is mostly used by other
cmdlets and is meant to be generic, thus it will not form the body ... |
PowerShellCorpus/PowerShellGallery/newrelic/0.0.5/Public/Invoke-NRRequest.ps1 | Invoke-NRRequest.ps1 | function Invoke-NRRequest {
<#
.SYNOPSIS
Builds up and submits a web request to the New Relic API.
.DESCRIPTION
Will build a properly structured web request to use for the New Relic API. This is mostly used by other
cmdlets and is meant to be generic, thus it will not form the body o... |
PowerShellCorpus/PowerShellGallery/newrelic/0.0.5/Public/Invoke-NRQLQuery.ps1 | Invoke-NRQLQuery.ps1 | function Invoke-NRQLQuery {
<#
.SYNOPSIS
Invokes a NRQL query
.DESCRIPTION
Invokes either and insert or query request against New Relic Insights
.EXAMPLE
$Query = Select * FROM
Invoke-NRQLQuery -AccountId '1111111' `
-Query "SELECT count(errorMes... |
PowerShellCorpus/PowerShellGallery/xStorage/3.1.0.0/Examples/Resources/xWaitForVolume/2-xWaitForVolume_ISO.ps1 | 2-xWaitForVolume_ISO.ps1 | <#
.EXAMPLE
This configuration will mount an ISO file as drive S:.
#>
configuration Example
{
Import-DscResource -ModuleName xStorage
xMountImage ISO
{
ImagePath = 'c:\Sources\SQL.iso'
DriveLetter = 'S'
}
xWaitForVolume WaitForISO
{
DriveLett... |
PowerShellCorpus/PowerShellGallery/xStorage/3.1.0.0/Examples/Resources/xWaitForVolume/1-xWaitForVolume_VHD.ps1 | 1-xWaitForVolume_VHD.ps1 | <#
.EXAMPLE
This configuration will mount a VHD file and wait for it to become available.
#>
configuration Example
{
Import-DscResource -ModuleName xStorage
xMountImage MountVHD
{
ImagePath = 'd:\Data\Disk1.vhd'
DriveLetter = 'V'
}
xWaitForVolume WaitForVH... |
PowerShellCorpus/PowerShellGallery/xStorage/3.1.0.0/Examples/Resources/xDiskAccessPath/2-xDiskAccessPath_InitializeDataDiskWithAccessPathUsingUniqueId.ps1 | 2-xDiskAccessPath_InitializeDataDiskWithAccessPathUsingUniqueId.ps1 | <#
.EXAMPLE
This configuration will wait for disk 2 with Unique Id '5E1E50A401000000001517FFFF0AEB84' to become
available, and then make the disk available as two new formatted volumes mounted to folders
c:\SQLData and c:\SQLLog, with c:\SQLLog using all available space after c:\SQLData... |
PowerShellCorpus/PowerShellGallery/xStorage/3.1.0.0/Examples/Resources/xDiskAccessPath/1-xDiskAccessPath_InitializeDataDiskWithAccessPath.ps1 | 1-xDiskAccessPath_InitializeDataDiskWithAccessPath.ps1 | <#
.EXAMPLE
This configuration will wait for disk 2 to become available, and then make the disk available as
two new formatted volumes mounted to folders c:\SQLData and c:\SQLLog, with c:\SQLLog using all
available space after c:\SQLData has been created.
#>
Configuration Example
{
... |
PowerShellCorpus/PowerShellGallery/xStorage/3.1.0.0/Examples/Resources/xDisk/2-xDisk_InitializeDataDiskUsingUniqueId.ps1 | 2-xDisk_InitializeDataDiskUsingUniqueId.ps1 | <#
.EXAMPLE
This configuration will wait for disk 2 with Unique Id '5E1E50A401000000001517FFFF0AEB84' to become
available, and then make the disk available as two new formatted volumes, 'G' and 'J', with 'J'
using all available space after 'G' has been created. It also creates a new ReFS... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.