full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/PowerShellGallery/xComputerManagement/1.10.0.0/Examples/Sample_xOfflineDomainJoin.ps1
Sample_xOfflineDomainJoin.ps1
configuration Sample_xOfflineDomainJoin { param ( [string[]]$NodeName = 'localhost' ) Import-DSCResource -ModuleName xComputerManagement Node $NodeName { xOfflineDomainJoin ODJ { RequestFile = 'C:\ODJ\ODJBlob.txt' IsSingleInstance = 'Ye...
PowerShellCorpus/PowerShellGallery/xComputerManagement/1.10.0.0/Tests/Unit/MSFT_xScheduledTask.Tests.ps1
MSFT_xScheduledTask.Tests.ps1
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingConvertToSecureStringWithPlainText", "")] param( ) $Global:DSCModuleName = 'xComputerManagement' $Global:DSCResourceName = 'MSFT_xScheduledTask' #region HEADER # Unit Test Template Version: 1.1.0 [String] $moduleRoot = Split-Path -Parent...
PowerShellCorpus/PowerShellGallery/xComputerManagement/1.10.0.0/Tests/Unit/MSFT_xComputer.Tests.ps1
MSFT_xComputer.Tests.ps1
$Global:DSCModuleName = 'xComputerManagement' $Global:DSCResourceName = 'MSFT_xComputer' #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.T...
PowerShellCorpus/PowerShellGallery/xComputerManagement/1.10.0.0/Tests/Unit/MSFT_xOfflineDomainJoin.tests.ps1
MSFT_xOfflineDomainJoin.tests.ps1
$Global:DSCModuleName = 'xComputerManagement' $Global:DSCResourceName = 'MSFT_xOfflineDomainJoin' #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 'DSCR...
PowerShellCorpus/PowerShellGallery/xComputerManagement/1.10.0.0/Tests/Unit/MSFT_xPowerPlan.Tests.ps1
MSFT_xPowerPlan.Tests.ps1
$script:DSCModuleName = 'xComputerManagement' $script:DSCResourceName = 'MSFT_xPowerPlan' #region HEADER # Unit Test Template Version: 1.2.0 $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCResour...
PowerShellCorpus/PowerShellGallery/xComputerManagement/1.10.0.0/Tests/Unit/MSFT_xVirtualMemory.Tests.ps1
MSFT_xVirtualMemory.Tests.ps1
#region HEADER $script:DSCModuleName = 'xComputerManagement' $script:DSCResourceName = 'MSFT_xVirtualMemory' # Unit Test Template Version: 1.2.0 $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -ChildPath 'DSCReso...
PowerShellCorpus/PowerShellGallery/xComputerManagement/1.10.0.0/Tests/Integration/MSFT_xVirtualMemory.Config.ps1
MSFT_xVirtualMemory.Config.ps1
Configuration setToAuto { Import-DscResource -ModuleName xComputerManagement node "localhost" { xVirtualMemory vMem { Type = 'AutoManagePagingFile' Drive = 'C' } } } Configuration setToCustom { Import-DscResource -ModuleName xComputerManagem...
PowerShellCorpus/PowerShellGallery/xComputerManagement/1.10.0.0/Tests/Integration/MSFT_xScheduledTask.Integration.Tests.ps1
MSFT_xScheduledTask.Integration.Tests.ps1
#Requires -Version 5.0 $Global:DSCModuleName = 'xComputerManagement' $Global:DSCResourceName = 'MSFT_xScheduledTask' #region HEADER # Unit Test Template Version: 1.1.0 [String] $moduleRoot = Split-Path -Parent (Split-Path -Parent (Split-Path -Parent $Script:MyInvocation.MyCommand.Path)) if ( (-not (Test...
PowerShellCorpus/PowerShellGallery/xComputerManagement/1.10.0.0/Tests/Integration/MSFT_xVirtualMemory.Integration.Tests.ps1
MSFT_xVirtualMemory.Integration.Tests.ps1
$script:DSCModuleName = 'xComputerManagement' $script:DSCResourceName = 'MSFT_xVirtualMemory' #region HEADER # Integration Test Template Version: 1.1.1 [String] $script:moduleRoot = Split-Path -Parent (Split-Path -Parent $PSScriptRoot) if ( (-not (Test-Path -Path (Join-Path -Path $script:moduleRoot -Ch...
PowerShellCorpus/PowerShellGallery/xComputerManagement/1.10.0.0/Tests/Integration/MSFT_xScheduledTask.Config.ps1
MSFT_xScheduledTask.Config.ps1
Configuration xScheduledTask_Add { Import-DscResource -ModuleName xComputerManagement node "localhost" { xScheduledTask xScheduledTask_Add { TaskName = "Test task" TaskPath = "\xComputerManagement\" ActionExecutable = "C:\windows\system32\WindowsPowerShell\v1.0...
PowerShellCorpus/PowerShellGallery/ProvanceITSM/0.7.0.0/functions/mainfunctions.ps1
mainfunctions.ps1
function New-ProvITSMCategoryMain { <# .Synopsis Creates a new Category .DESCRIPTION This function creates a new Category main record and gives back the new record for pipe-operations. If a category with the same name exists it emits a verbose message A Provance ITSM category has many mandatory ...
PowerShellCorpus/PowerShellGallery/ProvanceITSM/0.7.0.0/functions/helperfunctions.ps1
helperfunctions.ps1
function ConvertTo-ProvITSMStageName { <# .Synopsis Transform Stage GUID to Stage DisplayName .DESCRIPTION Many records in CRM are managed via a business provess. When those records are read, they emit a stage ID as GUID which is not human readable. This funtion transforms the stageUI GUID to a...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/Reload-ISEFile.ps1
Reload-ISEFile.ps1
#requires -version 4.0 <# reload an file in the ISE that might have been modified outside of the ISE. #> Function Reset-ISEFile { #save the current file path $path = $psise.CurrentFile.FullPath #get current index $i = $psise.CurrentPowerShellTab.files.IndexOf($psise.CurrentFile) #remove the file $psise...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/New-PSCommand.ps1
New-PSCommand.ps1
#requires -version 3.0 Function New-PSCommand { <# .SYNOPSIS Create an advanced function outline .DESCRIPTION This command will create the outline of an advanced function based on a hash table of new parameter values. You will still need to flesh out the function and insert the actual commands. You might ...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/Get-ASTScriptProfile.ps1
Get-ASTScriptProfile.ps1
#requires -version 3.0 #Get-ASTScriptProfile.ps1 Function Get-ASTProfile { <# .Synopsis Profile a PowerShell script .Description This script will parse a PowerShell script using the AST to identify elements and any items that might be dangerous. The output is a text report which by default is turned into a h...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/Print-ISEFile.ps1
Print-ISEFile.ps1
#requires -version 2.0 <# Comments: This function is intended to be used in the ISE to print the current script file to the default printer. #> Function Send-ToPrinter { Param([string]$path=$PSISE.CurrentFile.FullPath) Start-Process -filepath Notepad.exe -ArgumentList "/p",$path -WindowStyle Hidd...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/Bookmarks.ps1
Bookmarks.ps1
#requires -version 4.0 #create a script bookmarking system for the PowerShell ISE Function Get-ISEBookmark { [cmdletbinding()] Param() Write-Verbose "Importing bookmarks from $MyBookmarks" Try { Import-CSV $MyBookmarks -ErrorAction Stop | Out-GridView -Title "My ISE Bookmarks" -OutputMode Single ...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/New-PSDriveHere.ps1
New-PSDriveHere.ps1
#requires -version 2.0 Function New-PSDriveHere { <# .Synopsis Create a new PSDrive at the current location. .Description This function will create a new PSDrive at the specified location. The default is the current location, but you can specify any PSPath. The function will take the last word of the path a...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/ConvertTo-CommentHelp.ps1
ConvertTo-CommentHelp.ps1
#requires -version 3.0 <# this function will make a best effort to convert help from an existing cmdlet to comment based help. This is handy when building a proxy function. Converted help will be opened in a new ISE Tab. #> Function ConvertTo-CommentHelp { Param() Add-Type -AssemblyName "microsoft.vis...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/New-InputBox.ps1
New-InputBox.ps1
Function New-Inputbox { <# .Synopsis Display a Visual Basic style inputbox. .Description This function will display a graphical Inputbox, like the one from VisualBasic and VBScript. You must specify a messag prompt. You can specify a title, the default is "Input". You can also specify a default value. The inp...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/Get-SearchResult.ps1
Get-SearchResult.ps1
#requires -version 4.0 Function Get-SearchResult { [cmdletbinding()] Param( [Parameter(Position=0)] [ValidateNotNullorEmpty()] [string]$Text = $psise.currentfile.editor.selectedText, [ValidateSet("Bing","Google","Yahoo")] [string]$SearchEngine="Google" ) Switch ($SearchEngine) { "Bing" { $lang =...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/CurrentProjects.ps1
CurrentProjects.ps1
#requires -version 4.0 <# The list is a simple text file with the complete path to scripts you are working on. #> Function Add-CurrentProject { <# .Synopsis Add the file to the current project list file .Description This command adds the current file path to the current project list. The list is simply a...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/CloseAllFiles.ps1
CloseAllFiles.ps1
#requires -version 4.0 #close all saved files in the ISE Function CloseAllFiles { [cmdletbinding()] Param() $saved = $psISE.CurrentPowerShellTab.Files.Where({$_.isSaved}) foreach ($file in $saved) { write-Verbose "closing $($file.FullPath)" $psISE.CurrentPowerShellTab.files.Remove($file) | out-null }...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/ConvertFrom-Alias.ps1
ConvertFrom-Alias.ps1
#requires -version 2.0 Function ConvertFrom-Alias { Param ( [Parameter(Position=0)] [ValidateNotNullorEmpty()] $Text=$psISE.CurrentFile.Editor.text ) #make sure we are using the ISE if ($host.name -match "ISE"){ #Turn the script into syntax tokens Write-Verbose "Tokenizing" #verify ther...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/New-CommentHelp.ps1
New-CommentHelp.ps1
#requires -version 4.0 # Comments: This will generate comment based help based on a loaded command. #This works best in the ISE with your function already loaded. Function New-CommentHelp { Param( [Parameter(Position=0,Mandatory,HelpMessage = "What is the name of your function or command?" )] [ValidateNotN...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/Sign-ISEScript.ps1
Sign-ISEScript.ps1
#requires -version 2.0 Function Write-Signature { Param() Set-StrictMode -Version Latest #get the certificate $cert = Get-ChildItem -Path Cert:\CurrentUser\My -CodeSigningCert If ($cert.Count -eq '0') { Write-Warning 'No code signing certificate found.' Exit } ElseIf ($cert.Count -gt '1') { ...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/Copy-ToWord.ps1
Copy-ToWord.ps1
#requires -version 3.0 #this is an ISE only function #copy selected ISE text to Microsoft Word Function Copy-ToWord { [cmdletbinding()] Param( [ValidatePattern("\S+")] [string[]]$Text = $psise.CurrentFile.Editor.SelectedText, [switch]$Colorized ) If (($global:word.Application -eq $Null) -OR -NOT (Get-Pr...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/ConvertAll.ps1
ConvertAll.ps1
#requires -version 2.0 #converts all command aliases in selected text to their corresponding command #definition Function ConvertTo-Definition { [cmdletbinding()] Param( [Parameter(Position=0,Mandatory=$True,HelpMessage="Enter a string to convert")] [string]$Text ) if ($host.name -match "ISE") { ...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/Convert-CommandToHash.ps1
Convert-CommandToHash.ps1
#requires -version 3.0 #Convert the named parameter part of a command into a hash table in the ISE Function Convert-CommandtoHash { [cmdletbinding()] Param( [ValidateNotNullorEmpty()] [string]$Text = $psise.currentfile.editor.SelectedText ) Set-StrictMode -Version latest New-Variable astTokens -force ...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/Convert-CodetoSnippet.ps1
Convert-CodetoSnippet.ps1
#requires -version 3.0 Function Convert-CodetoSnippet { [cmdletbinding(SupportsShouldProcess=$True)] Param( [Parameter(Position=0,Mandatory=$True, HelpMessage="Enter some code text or break, select text in the ISE and try again.")] [ValidateNotNullorEmpty()] [string]$Text ) Add-Type -AssemblyName "Micros...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/Get-ScriptComments.ps1
Get-ScriptComments.ps1
#requires -version 4.0 #parse a script file for comments only Function Get-ScriptComments { <# .Synopsis Get comments from a PowerShell script file. .Description This command will use the AST parser to go through a PowerShell script, either a .ps1 or .psm1 file, and display only the comments. .Example PS C...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/Out-ISETab.ps1
Out-ISETab.ps1
#requires -version 2.0 <# This function will take pipelined input and insert into a new PowerShell ISE tab #> Function Out-ISETab { <# .Synopsis Send command output to an ISE tab .Description This command will accept pipelined input and place it in a new PowerShell ISE tab. .Parameter UseCurrentFile Ins...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/Edit-Snippet.ps1
Edit-Snippet.ps1
#requires -version 4.0 <# view snippets and edit selected in the PowerShell ISE Changes won't be effective until the next ISE session or tab #> Function Edit-Snippet { Param( [string]$Path = "$env:userprofile\Documents\WindowsPowerShell\Snippets" ) #display snippets by name without the .snippet.ps1xml exte...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/ConvertTo-TextFile.ps1
ConvertTo-TextFile.ps1
#requires -version 2.0 Function ConvertTo-TextFile { Param ( [switch]$Reload ) #verify we are in the ISE if ($psise) { #get the current file name and path and change the extension $psVersion=$psise.CurrentFile.FullPath $textVersion=$psversion -replace "ps1"...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/Open-SelectedInISE.ps1
Open-SelectedInISE.ps1
#requires -version 3.0 #open selected file in an ISE Tab. #modified to trim off any extra spaces and write if warning if file not found Function Open-SelectedISE { [cmdletbinding()] Param([string]$Text = $psise.CurrentFile.Editor.SelectedText) #trim off any spaces $file = $Text.Trim() if (Test-Path -P...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/Find-InFile.ps1
Find-InFile.ps1
#Requires -version 3.0 Function Find-InFile { [cmdletbinding()] Param() Set-StrictMode -Version Latest Write-Verbose "Starting $($myinvocation.mycommand)" #verify we are in the ISE if ($host.name -match "ISE") { $Title = "Find in Files" #prompt for file types to search $Prompt = "Enter...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/Convert-AliasDefinition.ps1
Convert-AliasDefinition.ps1
#requires -version 2.0 Function Convert-AliasDefinition { [cmdletBinding(DefaultParameterSetName="ToDefinition")] Param( [Parameter(Position=0,Mandatory=$True,HelpMessage="Enter a string to convert")] [string]$Text, [Parameter(ParameterSetName="ToAlias")] [switch]$ToAlias, [Parameter(ParameterSetName="ToD...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/New-ISEFunction.ps1
New-ISEFunction.ps1
Function New-Function { $name= Read-Host "What do you want to call the new function?" $functionText=@" #requires -version 4.0 # ----------------------------------------------------------------------------- # Script: $name.ps1 # Author: $env:username # Date: $((get-date).ToShortDateString()) # Keywords...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/Convert-ISEComment.ps1
Convert-ISEComment.ps1
#requires -version 3.0 #convert selected text into a multi-line comment Function ConvertTo-MultiLineComment { [cmdletbinding()] Param([string]$Text = $psise.CurrentFile.Editor.SelectedText) if ($text -match "^<#" -AND $text -match "#>$") { Write-Warning "Selected text already appears to be a multiline comm...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/get-commandmetadata.ps1
get-commandmetadata.ps1
#requires -version 3.0 #run this in the PowerShell ISE for best results Function Get-CommandMetadata { <# .Synopsis Create a proxy function of a PowerShell command. .Description This command will create a proxy version of a PowerShell cmdlet, function or alias. The intent is to simplify creating a new func...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/CycleISETabs.ps1
CycleISETabs.ps1
#requires -version 3.0 #cycle through PowerShell Tabs #this needs to be in your PowerShell ISE profile to work properly Function Get-NextISETab { [cmdletbinding()] Param() $iseTabs = $psISE.PowerShellTabs #get current tab for ($i=0; $i -le $iseTabs.count-1; $i++) { Write-Verbose $iseTabs[$i].Display...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/New-DSCResourceSnippet.ps1
New-DSCResourceSnippet.ps1
#requires -version 4.0 #requires -module PSDesiredStateConfiguration Function New-DSCResourceSnippet { <# .Synopsis Create ISE snippets for DSC Resources .Description This command will convert the syntax for a DSC resource into an ISE snippet. Snippets will be created in the default location. Snippet names w...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/CIMScriptMaker.ps1
CIMScriptMaker.ps1
#requires -version 3.0 <# Version: 3.0 Author : Jeff Hicks @jeffhicks http://jdhitsolutions.com/blog "Those who forget to script are doomed to repeat their work." Learn more about PowerShell: http://jdhitsolutions.com/blog/essential-powershell-resources/ ***************************...
PowerShellCorpus/PowerShellGallery/ISEScriptingGeek/3.3.1.3/New-FileHere.ps1
New-FileHere.ps1
#requires -version 4.0 <# #> Function New-FileHere { <# .Synopsis Create a new file in the current path. .Description When you create a new file, the ISE wants to create it in the directory you were in when you started the ISE. I often want to create a new file in the current location. This command has no para...
PowerShellCorpus/PowerShellGallery/PoShKeePass/2.0.4.0/Test/PSKeePassUsage.Tests.ps1
PSKeePassUsage.Tests.ps1
Get-Module PoShKeePass | Remove-Module Import-Module "$PSScriptRoot\..\PoShKeePass.psm1" -force -ErrorAction Stop InModuleScope "PoShKeePass" { Import-KPLibrary $WarningPreference = 'SilentlyContinue' Describe "New-KPConnection - UnitTest" -Tag UnitTest { Context "Example 1: Open wit...
PowerShellCorpus/PowerShellGallery/PoShKeePass/2.0.4.0/bin/EncodeKeePassLib.ps1
EncodeKeePassLib.ps1
# $Content = Get-Content -Path "$PSScriptRoot\KeePassLib.dll" -Encoding Byte # $Base64 = [Convert]::ToBase64String($Content) # $Base64 | Out-File -FilePath "$PSScriptRoot\KeePassLib_Encoded.txt" function Out-CompressedDll { [CmdletBinding()] Param ( [Parameter(Mandatory = $True)] [String] ...
PowerShellCorpus/PowerShellGallery/PoShKeePass/2.0.4.0/bin/AutoVersion.ps1
AutoVersion.ps1
## Get psd1 file $RawPSD = Get-Content -Path "$($PSScriptRoot)\..\PoShKeePass.psd1" $ModuleVersion=($RawPSD | ? { $_ -match "^ModuleVersion.*$" }) -replace "^.*=\s|'" [Int[]] $VerArr = $ModuleVersion -split '\.' $NewModuleVersion = '' $CarryValue = 1 $EntryPoint = $($VerArr.Count -1) for($i=$EntryPoint; $i -...
PowerShellCorpus/PowerShellGallery/posh-tex/0.1.5/cmdlets/Core.ps1
Core.ps1
#!/usr/bin/env powershell ## # Core.ps1: Cmdlets common across PoShTeX. ## # © 2017 Christopher Granade (cgranade@cgranade.com) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistributions of source code mus...
PowerShellCorpus/PowerShellGallery/posh-tex/0.1.5/cmdlets/Pandoc.ps1
Pandoc.ps1
#!/usr/bin/env powershell ## # Pandoc.ps1: Cmdlets for interacting with Pandoc installations. ## # © 2017 Christopher Granade (cgranade@cgranade.com) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Re...
PowerShellCorpus/PowerShellGallery/posh-tex/0.1.5/cmdlets/CTAN.ps1
CTAN.ps1
#!/usr/bin/env powershell ## # CTAN.ps1: Cmdlets for building CTAN-ready ZIP archives. ## # © 2017 Christopher Granade (cgranade@cgranade.com) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistrib...
PowerShellCorpus/PowerShellGallery/posh-tex/0.1.5/cmdlets/ArXiv.ps1
ArXiv.ps1
#!/usr/bin/env powershell ## # ArXiv.ps1: Cmdlets for building arXix-ready ZIP archives. ## # © 2017 Christopher Granade (cgranade@cgranade.com) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistr...
PowerShellCorpus/PowerShellGallery/posh-tex/0.1.5/cmdlets/Jupyter.ps1
Jupyter.ps1
#!/usr/bin/env powershell ## # Jupyter.ps1: Cmdlets for working with Jupyter notebooks. ## # © 2017 Christopher Granade (cgranade@cgranade.com) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redistri...
PowerShellCorpus/PowerShellGallery/posh-tex/0.1.5/cmdlets/TeX.ps1
TeX.ps1
#!/usr/bin/env powershell ## # TeX.ps1: Cmdlets for interacting with MiKTeX, TeX Live, etc. ## # © 2017 Christopher Granade (cgranade@cgranade.com) # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # 1. Redi...
PowerShellCorpus/PowerShellGallery/MSGraphAPI/0.3.8/MSGraphAPIClasses.ps1
MSGraphAPIClasses.ps1
Class microsoft_graph_entity_v1_0 { [object]$id; [hashtable]$GraphAdditionalProperties = @{}; } Class microsoft_graph_directoryObject_v1_0 : microsoft_graph_entity_v1_0 { } Class microsoft_graph_device_v1_0 : microsoft_graph_directoryObject_v1_0 { [object]$accountEnabled; [object]$operatingSystem; [object]$displayNa...
PowerShellCorpus/PowerShellGallery/MSGraphAPI/0.3.8/MetadataExplorer/MetadataExplorer.ps1
MetadataExplorer.ps1
Add-Type -AssemblyName PresentationFramework,PresentationCore,WindowsBase Function New-GraphXAMLClass { Param ( $ClassName, $ClassHash ) $Class = @" using System.ComponentModel; using System.Windows; public class $ClassName : INotifyPropertyChanged { "@ Foreach ($Key in...
PowerShellCorpus/PowerShellGallery/MSGraphAPI/0.3.8/AzureAD/AzureAD-Device.ps1
AzureAD-Device.ps1
Function Get-GraphDevices { <# .SYNOPSIS Will get all the devices by querying Microsoft Graph .DESCRIPTION Queries for devices .EXAMPLE Get-GraphDevices This will list all devices the authenticated user can see in Azure .PARAMETER Filter This param...
PowerShellCorpus/PowerShellGallery/MSGraphAPI/0.3.8/AzureAD/AzureAD-Group.ps1
AzureAD-Group.ps1
Function Get-GraphGroup { <# .SYNOPSIS Querys the Groups endpoint to get a list of Azure AD groups .DESCRIPTION Queries groups in Azure AD .EXAMPLE Get-GraphGroups -Filter "startswith(displayName,'Sec')" .PARAMETER Filter Use OData filter query. Additional ...
PowerShellCorpus/PowerShellGallery/MSGraphAPI/0.3.8/AzureAD/AzureAD-User.ps1
AzureAD-User.ps1
Function Get-GraphUsers { <# .SYNOPSIS Used to get a list of users in Azure AD .DESCRIPTION Queries Graph /users to get information on users in Azure AD .EXAMPLE Get-GraphUsers -Filter "startswith(displayName,'Sec')" .PARAMETER Filter Use OData filter query...
PowerShellCorpus/PowerShellGallery/MSGraphAPI/0.3.8/Directory/Directory-SubscribedSku.ps1
Directory-SubscribedSku.ps1
Function Get-GraphSubscribedSkus { <# .SYNOPSIS Will list subscribedSkus from Graph .DESCRIPTION Contains information about a service SKU that a company is subscribed to. Only the read operation is supported on subscribed SKUs; create, update, and delete are not supported. Query ...
PowerShellCorpus/PowerShellGallery/MSGraphAPI/0.3.8/Intune/Intune-DeviceCateogry.ps1
Intune-DeviceCateogry.ps1
Function New-GraphIntuneDeviceCateogry { <# .SYNOPSIS Will create a new Device Category .DESCRIPTION Calls post method to deviceManagement/deviceCategories .EXAMPLE New-GraphIntuneDeviceCateogry -DisplayName 'Category' -Description 'My description' .PARAMETER Displa...
PowerShellCorpus/PowerShellGallery/MSGraphAPI/0.3.8/Intune/Intune-VersionInfo.ps1
Intune-VersionInfo.ps1
Function Get-GraphIntuneVersion { <# .SYNOPSIS Helper function for Graph version .DESCRIPTION Help function so the version info only needs to be changed in one spot when Intune switches from beta to v1.0 .EXAMPLE Get-GraphIntuneVersion .LINK https://github....
PowerShellCorpus/PowerShellGallery/MSGraphAPI/0.3.8/Intune/Intune-Apps.ps1
Intune-Apps.ps1
Function New-GraphIntuneApp { <# .SYNOPSIS Creates a Intune App through Graph .DESCRIPTION Creates an Intune app. Currently in Beta through Graph .EXAMPLE New-GraphIntuneApp -ApplicationType 'Android Store App' -DisplayName 'Candy Crush' -Description 'A game that shouldn't...
PowerShellCorpus/PowerShellGallery/MSGraphAPI/0.3.8/Intune/Intune-DeviceProfiles.ps1
Intune-DeviceProfiles.ps1
<#Function New-GraphIntuneDeviceProfile { Param( [Parameter(Mandatory=$true)] [ValidateSet( 'Android LOB App', 'Android Store App', 'iOS LOB App', 'iOS Store App', 'Web App', 'Windows Phone 8.1 Store App', ...
PowerShellCorpus/PowerShellGallery/GoogleCloud/1.0.0.5/AppendPsModulePath.ps1
AppendPsModulePath.ps1
# Copyright 2015-2016 Google Inc. All Rights Reserved. # Licensed under the Apache License Version 2.0. # # Appends the Cloud Tools for PowerShell module location to the registry's PSModulePath environment # variable param($installPath) # Let a user manually select a Cloud SDK install path $installPath = $insta...
PowerShellCorpus/PowerShellGallery/GoogleCloud/1.0.0.5/BootstrapCloudToolsForPowerShell.ps1
BootstrapCloudToolsForPowerShell.ps1
# Copyright 2015 Google Inc. All Rights Reserved. # Licensed under the Apache License Version 2.0. # # Bootstraps the Google Cloud cmdlets into the current PowerShell session. function Get-ScriptDirectory { $invocation = (Get-Variable MyInvocation -Scope 1).Value return Split-Path $invocation.MyCommand...
PowerShellCorpus/PowerShellGallery/GoogleCloud/1.0.0.5/PatchFromGcs.ps1
PatchFromGcs.ps1
# Copyright 2015-2016 Google Inc. All Rights Reserved. # Licensed under the Apache License Version 2.0. # # Updates Cloud Tools for PowerShell module to the latest found in # Google Cloud Storage bucket g-cloudsharp-unsignedbinaries. # Let a user manually select a Cloud SDK install path param($installPath) $i...
PowerShellCorpus/PowerShellGallery/MrAD/1.0/Compare-MrADGroup.ps1
Compare-MrADGroup.ps1
#Requires -Version 3.0 -Modules ActiveDirectory function Compare-MrADGroup { <# .SYNOPSIS Compares the groups of a the specified Active Directory users. .DESCRIPTION Compare-MrADGroup is a function that retrieves a list of all the Active Directory groups that the specified Active Directory users ...
PowerShellCorpus/PowerShellGallery/MrAD/1.0/Get-MrADLockOutInfo.ps1
Get-MrADLockOutInfo.ps1
#Requires -Version 3.0 function Get-MrADLockOutInfo { <# .SYNOPSIS Get-MrADLockOutInfo returns a list of users who were locked out in Active Directory. .DESCRIPTION Get-MrADLockOutInfo is an advanced function that returns a list of users who were locked out in Active Directory by querying ...
PowerShellCorpus/PowerShellGallery/MrAD/1.0/Get-MrADUser.ps1
Get-MrADUser.ps1
#Requires -Version 3.0 function Get-MrADUser { [CmdletBinding()] param( [Parameter(Mandatory, ValueFromPipeline, ValueFromPipelineByPropertyName)] [String[]]$UserName ) PROCESS { foreach ($user in $UserName){ ...
PowerShellCorpus/PowerShellGallery/PSGELF/1.0/Private/Compress-PSGelfString.ps1
Compress-PSGelfString.ps1
function Compress-PSGelfString ([String]$ToZip) { #This creates a Byte array of GZiPd data. $ms = New-Object System.IO.MemoryStream $cs = New-Object System.IO.Compression.GZipStream($ms, [System.IO.Compression.CompressionMode]::Compress) $sw = New-Object System.IO.StreamWriter($cs) $sw.Write($T...
PowerShellCorpus/PowerShellGallery/PSGELF/1.0/Private/New-PSGelfObject.ps1
New-PSGelfObject.ps1
function New-PSGelfObject { [cmdletbinding()] Param ( [Parameter(Mandatory)][String]$GelfServer, [Parameter(Mandatory)][Int]$Port, [Parameter()][String]$HostName, [Parameter(Mandatory)][String]$ShortMessage, [Parameter()][String]$FullMessage, ...
PowerShellCorpus/PowerShellGallery/PSGELF/1.0/Private/Repair-PSGelfObject.ps1
Repair-PSGelfObject.ps1
function Repair-PSGelfObject { [cmdletbinding()] Param ( [Parameter(Mandatory )][PSCustomObject]$GelfMessage ) #Most of these changes are so you can easily pipe Get-WinEvent to this function. if($GelfMessage.MachineName) { Write-Verbose 'The property Ma...
PowerShellCorpus/PowerShellGallery/PSGELF/1.0/Public/Send-PSGelfUDPFromObject.ps1
Send-PSGelfUDPFromObject.ps1
<# .Synopsis Sends an PSObject to Graylog via UDP. .DESCRIPTION This function sends an PSObject to Graylog via UDP to a server supporting GELF. This function should be used if you do want to pipe input. .EXAMPLE Get-WinEvent Setup | Send-PSGelfUDPFromObject -GelfServer graylog -Port 12202 #> function S...
PowerShellCorpus/PowerShellGallery/PSGELF/1.0/Public/Send-PSGelfTCPFromObject.ps1
Send-PSGelfTCPFromObject.ps1
<# .Synopsis Sends an PSObject to Graylog via TCP. .DESCRIPTION This function sends an PSObject to Graylog via TCP to a server supporting GELF. This function should be used if you do want to pipe input. .EXAMPLE Get-WinEvent Setup | Send-PSGelfTCPFromObject -GelfServer graylog -Port 12201 #> function S...
PowerShellCorpus/PowerShellGallery/PSGELF/1.0/Public/Send-PSGelfTCP.ps1
Send-PSGelfTCP.ps1
<# .Synopsis Sends a GELF message via TCP. .DESCRIPTION This function sends a GELF message via TCP to a server supporting GELF. This function should be used if you don't want to pipe input. .EXAMPLE Send-PSGelfTCP -GelfServer graylog -Port 12202 -ShortMessage "This is a short message" .EXAMPLE Send-...
PowerShellCorpus/PowerShellGallery/PSGELF/1.0/Public/Send-PSGelfUDP.ps1
Send-PSGelfUDP.ps1
<# .Synopsis Sends a GELF message via UDP. .DESCRIPTION This function sends a GELF message via UDP to a server supporting GELF. This function should be used if you don't want to pipe input. .EXAMPLE Send-PSGelfUDP -GelfServer graylog -Port 12201 -ShortMessage "This is a short message" .EXAMPLE Send-...
PowerShellCorpus/PowerShellGallery/AzureGraphCmdlets/1.0.727.1/Install-AzureGraphCmdletsModule.ps1
Install-AzureGraphCmdletsModule.ps1
<# .SYNOPSIS Installs the AzureGraphCmdlets module to the user's modules folder. .DESCRIPTION Installs the AzureGraphCmdlets module to the user's modules folder. Replaces any existing versions of the PowerShell module. .EXAMPLE Install-AzureGraphCmdletsModule.ps1 Installs the AzureGraphCmdlets mo...
PowerShellCorpus/PowerShellGallery/WinSCP/5.9.5.6/Private/Format-WinSCPPathString.ps1
Format-WinSCPPathString.ps1
<# .SYNOPSIS Properly formats a path string for WinSCP. .DESCRIPTION This help function is used to properly format a path string for WinSCP to avoid syntax errors. .INPUTS System.String. .OUTPUTS System.String. .PARAMETER Path The path string to be formated. .EXAMPLE Format-WinSCPPathString -Pat...
PowerShellCorpus/PowerShellGallery/WinSCP/5.9.5.6/Public/Get-WinSCPItem.ps1
Get-WinSCPItem.ps1
Function Get-WinSCPItem { [CmdletBinding( HelpUri = 'https://github.com/dotps1/WinSCP/wiki/Get-WinSCPItem' )] [OutputType( [WinSCP.RemoteFileInfo] )] Param ( [Parameter( Mandatory = $true, ValueFromPipeline = $true )] [ValidateScri...
PowerShellCorpus/PowerShellGallery/WinSCP/5.9.5.6/Public/Test-WinSCPPath.ps1
Test-WinSCPPath.ps1
Function Test-WinSCPPath { [CmdletBinding( HelpUri = 'https://github.com/dotps1/WinSCP/wiki/Test-WinSCPPath' )] [OutputType( [Bool] )] Param ( [Parameter( Mandatory = $true, ValueFromPipeline = $true )] [ValidateScript({ ...
PowerShellCorpus/PowerShellGallery/WinSCP/5.9.5.6/Public/Get-WinSCPChildItem.ps1
Get-WinSCPChildItem.ps1
Function Get-WinSCPChildItem { [CmdletBinding( HelpUri = 'https://github.com/dotps1/WinSCP/wiki/Get-WinSCPChildItem' )] [OutputType( [Array] )] Param ( [Parameter( Mandatory = $true, ValueFromPipeline = $true )] [ValidateScript({ ...
PowerShellCorpus/PowerShellGallery/WinSCP/5.9.5.6/Public/New-WinSCPSession.ps1
New-WinSCPSession.ps1
Function New-WinSCPSession { [CmdletBinding( SupportsShouldProcess = $true, HelpUri = 'https://github.com/dotps1/WinSCP/wiki/New-WinSCPSession' )] [OutputType( [WinSCP.Session] )] Param ( [Parameter( Mandatory = $true, ValueFromPipeline = ...
PowerShellCorpus/PowerShellGallery/WinSCP/5.9.5.6/Public/New-WinSCPTransferOption.ps1
New-WinSCPTransferOption.ps1
Function New-WinSCPTransferOption { [CmdletBinding( SupportsShouldProcess = $true, HelpUri = 'https://github.com/dotps1/WinSCP/wiki/New-WinSCPTransferOption' )] [OutputType( [WinSCP.TransferOptions] )] Param ( [Parameter()] [String] $FileMask = $null,...
PowerShellCorpus/PowerShellGallery/WinSCP/5.9.5.6/Public/Rename-WinSCPItem.ps1
Rename-WinSCPItem.ps1
Function Rename-WinSCPItem { [CmdletBinding( HelpUri = 'https://github.com/dotps1/WinSCP/wiki/Rename-WinSCPItem' )] [OutputType( [Void] )] Param ( [Parameter( Mandatory = $true, ValueFromPipeline = $true )] [ValidateScript({ ...
PowerShellCorpus/PowerShellGallery/WinSCP/5.9.5.6/Public/Get-WinSCPItemChecksum.ps1
Get-WinSCPItemChecksum.ps1
Function Get-WinSCPItemChecksum { [CmdletBinding( HelpUri = 'https://github.com/dotps1/WinSCP/wiki/Get-WinSCPItemChecksum' )] [OutputType( [Array] )] Param ( [Parameter( Mandatory = $true, ValueFromPipeline = $true )] [ValidateScript({...
PowerShellCorpus/PowerShellGallery/WinSCP/5.9.5.6/Public/Invoke-WinSCPCommand.ps1
Invoke-WinSCPCommand.ps1
Function Invoke-WinSCPCommand { [CmdletBinding( HelpUri = 'https://github.com/dotps1/WinSCP/wiki/Invoke-WinSCPCommand' )] [OutputType( [WinSCP.CommandExecutionResult] )] Param ( [Parameter( Mandatory = $true, ValueFromPipeline = $true )] ...
PowerShellCorpus/PowerShellGallery/WinSCP/5.9.5.6/Public/Send-WinSCPItem.ps1
Send-WinSCPItem.ps1
Function Send-WinSCPItem { [CmdletBinding( HelpUri = 'https://github.com/dotps1/WinSCP/wiki/Send-WinSCPItem' )] [OutputType( [WinSCP.TransferOperationResult] )] Param ( [Parameter( Mandatory = $true, ValueFromPipeline = $true )] [Valid...
PowerShellCorpus/PowerShellGallery/WinSCP/5.9.5.6/Public/Start-WinSCPConsole.ps1
Start-WinSCPConsole.ps1
Function Start-WinSCPConsole { [CmdletBinding( ConfirmImpact = "None", HelpUri = 'https://github.com/dotps1/WinSCP/wiki/Start-WinSCPConsole', SupportsShouldProcess = $true )] [OutputType( [Void] )] Param() $process = "$PSScriptRoot\..\bin\WinSCP.exe" $args =...
PowerShellCorpus/PowerShellGallery/WinSCP/5.9.5.6/Public/ConvertTo-WinSCPEscapedString.ps1
ConvertTo-WinSCPEscapedString.ps1
Function ConvertTo-WinSCPEscapedString { [CmdletBinding( HelpUri = 'https://github.com/dotps1/WinSCP/wiki/ConvertTo-WinSCPEscapedString' )] [OutputType( [String] )] Param ( [Parameter( Mandatory = $true, ValueFromPipeline = $true, ValueFro...
PowerShellCorpus/PowerShellGallery/WinSCP/5.9.5.6/Public/Remove-WinSCPSession.ps1
Remove-WinSCPSession.ps1
Function Remove-WinSCPSession { [CmdletBinding( HelpUri = 'https://github.com/dotps1/WinSCP/wiki/Remove-WinSCPSession' )] [OutputType([ Void] )] Param ( [Parameter( Mandatory = $true, ValueFromPipeline = $true )] [WinSCP.Session] ...
PowerShellCorpus/PowerShellGallery/WinSCP/5.9.5.6/Public/Receive-WinSCPItem.ps1
Receive-WinSCPItem.ps1
Function Receive-WinSCPItem { [CmdletBinding( HelpUri = 'https://github.com/dotps1/WinSCP/wiki/Receive-WinSCPItem' )] [OutputType( [WinSCP.TransferOperationResult] )] Param ( [Parameter( Mandatory = $true, ValueFromPipeline = $true )] ...
PowerShellCorpus/PowerShellGallery/WinSCP/5.9.5.6/Public/Remove-WinSCPItem.ps1
Remove-WinSCPItem.ps1
Function Remove-WinSCPItem { [CmdletBinding( SupportsShouldProcess = $true, ConfirmImpact = 'High', HelpUri = 'https://github.com/dotps1/WinSCP/wiki/Remove-WinSCPItem' )] [OutputType( [Void] )] Param ( [Parameter( Mandatory = $true, ...
PowerShellCorpus/PowerShellGallery/WinSCP/5.9.5.6/Public/New-WinSCPItemPermission.ps1
New-WinSCPItemPermission.ps1
Function New-WinSCPItemPermission { [CmdletBinding( SupportsShouldProcess = $true, HelpUri = 'https://github.com/dotps1/WinSCP/wiki/New-WinSCPItemPermission' )] [OutputType( [WinSCP.FilePermissions] )] Param ( [Parameter()] [Switch] $GroupExecute, ...
PowerShellCorpus/PowerShellGallery/WinSCP/5.9.5.6/Public/Move-WinSCPItem.ps1
Move-WinSCPItem.ps1
Function Move-WinSCPItem { [CmdletBinding( HelpUri = 'https://github.com/dotps1/WinSCP/wiki/Move-WinSCPItem' )] [OutputType( [Void] )] Param ( [Parameter( Mandatory = $true, ValueFromPipeline = $true )] [ValidateScript({ ...
PowerShellCorpus/PowerShellGallery/WinSCP/5.9.5.6/Public/Sync-WinSCPPath.ps1
Sync-WinSCPPath.ps1
Function Sync-WinSCPPath { [CmdletBinding( HelpUri = 'https://github.com/dotps1/WinSCP/wiki/Sync-WinSCPPath' )] [OutputType( [WinSCP.SynchronizationResult] )] Param ( [Parameter( Mandatory = $true, ValueFromPipeline = $true )] [Validat...
PowerShellCorpus/PowerShellGallery/WinSCP/5.9.5.6/Public/New-WinSCPItem.ps1
New-WinSCPItem.ps1
Function New-WinSCPItem { [CmdletBinding( SupportsShouldProcess = $true, HelpUri = 'https://github.com/dotps1/WinSCP/wiki/New-WinSCPItem' )] [OutputType( [WinSCP.RemoteFileInfo] )] Param ( [Parameter( Mandatory = $true, ValueFromPipeline =...
PowerShellCorpus/PowerShellGallery/FastLookup/1.2/Test-FastLookup.ps1
Test-FastLookup.ps1
function Test-FastLookup { <# .SYNOPSIS Designed to optimize the speed of searching an array. .DESCRIPTION Improve the speed of looking up a value in an array by creating a hashtable index. Good for looping through very large arrays or CSV files .NOTES Version...
PowerShellCorpus/PowerShellGallery/FastLookup/1.2/New-FastLookup.ps1
New-FastLookup.ps1
function New-FastLookup { <# .SYNOPSIS Designed to optimize the speed of searching an array. .DESCRIPTION Improve the speed of looking up a value in an array by creating a hashtable index. Good for looping through very large arrays or CSV files .NOTES Version:...
PowerShellCorpus/PowerShellGallery/FastLookup/1.2/Get-FastLookup.ps1
Get-FastLookup.ps1
function Get-FastLookup { <# .SYNOPSIS Designed to optimize the speed of searching an array. .DESCRIPTION Improve the speed of looking up a value in an array by creating a hashtable index. Good for looping through very large arrays or CSV files .NOTES Version...
PowerShellCorpus/PowerShellGallery/ciSCSI/1.2.1.95/Examples/Sample_ciSCSIInitiator.ps1
Sample_ciSCSIInitiator.ps1
configuration Sample_ciSCSIInitiator { Param ( [String] $NodeName = 'LocalHost' ) Import-DscResource -Module ciSCSI Node $NodeName { Service iSCSIService { Name = 'MSiSCSI' StartupType = 'Automatic' State = 'Running' } ...