full_path
stringlengths
31
232
filename
stringlengths
4
167
content
stringlengths
0
48.3M
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/CommandHistory.ps1
CommandHistory.ps1
class CommandHistory { [string]$Id # ID of command [string]$CommandId # ID of caller [string]$CallerId # Command results [CommandResult]$Result [ParsedCommand]$ParsedCommand # Date/time command was executed [datetime]$Time CommandHistory([string]$Comm...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/Role.ps1
Role.ps1
class Role { [string]$Name [string]$Description [hashtable]$Permissions = @{} Role([string]$Name) { $this.Name = $Name } Role([string]$Name, [string]$Description) { $this.Name = $Name $this.Description = $Description } [void]AddPermission([Permi...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/Group.ps1
Group.ps1
# A group contains a collection of users and a collection of roles # those users will be a member of class Group { [string]$Name [string]$Description [hashtable]$Users = @{} [hashtable]$Roles = @{} Group([string]$Name) { $this.Name = $Name } Group([string]$Name, [stri...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/CommandResult.ps1
CommandResult.ps1
class Stream { [object[]]$Debug = @() [object[]]$Error = @() [object[]]$Information = @() [object[]]$Verbose = @() [object[]]$Warning = @() } # Represents the result of running a command class CommandResult { [bool]$Success [object[]]$Errors = @() [object[]]$Output = @() ...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/RoleManager.ps1
RoleManager.ps1
class RoleManager { [hashtable]$Groups = @{} [hashtable]$Permissions = @{} [hashtable]$Roles = @{} [hashtable]$RoleUserMapping = @{} hidden [object]$_Backend hidden [StorageProvider]$_Storage hidden [Logger]$_Logger RoleManager([object]$Backend, [StorageProvider]$Storage, [Lo...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/AccessFilter.ps1
AccessFilter.ps1
class CommandAuthorizationResult { [bool]$Authorized [string]$Message CommandAuthorizationResult() { $this.Authorized = $true } CommandAuthorizationResult([bool]$Authorized) { $this.Authorized = $Authorized } CommandAuthorizationResult([bool]$Authorized, [str...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/PluginManager.ps1
PluginManager.ps1
class PluginManager { [hashtable]$Plugins = @{} [hashtable]$Commands = @{} hidden [string]$_PoshBotModuleDir [RoleManager]$RoleManager [StorageProvider]$_Storage [Logger]$Logger PluginManager([RoleManager]$RoleManager, [StorageProvider]$Storage, [Logger]$Logger, [string]$PoshBot...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/Trigger.ps1
Trigger.ps1
class Trigger { [TriggerType]$Type [string]$Trigger [MessageType]$MessageType = [MessageType]::Message [MessageSubType]$MessageSubtype = [Messagesubtype]::None Trigger([TriggerType]$Type, [string]$Trigger) { $this.Type = $Type $this.Trigger = $Trigger } }
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/PluginCommand.ps1
PluginCommand.ps1
class PluginCommand { [Plugin]$Plugin [Command]$Command PluginCommand([Plugin]$Plugin, [Command]$Command) { $this.Plugin = $Plugin $this.Command = $Command } [string]ToString() { return "$($this.Plugin.Name):$($this.Command.Name)" } }
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/CommandExecutor.ps1
CommandExecutor.ps1
# In charge of executing and tracking progress of commands class CommandExecutor { [RoleManager]$RoleManager [int]$HistoryToKeep = 100 [int]$ExecutedCount = 0 # Recent history of commands executed [System.Collections.ArrayList]$History = (New-Object System.Collections.ArrayList) ...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/Message.ps1
Message.ps1
enum MessageType { ChannelRenamed Message PinAdded PinRemoved PresenceChange ReactionAdded ReactionRemoved StarAdded StarRemoved } enum MessageSubtype { None ChannelJoined ChannelLeft ChannelRenamed ChannelPurposeChanged ChannelTopicChange...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/Backend.ps1
Backend.ps1
# This generic Backend class provides the base scaffolding to represent a Chat network class Backend { [string]$Name [string]$BotId # Connection information for the chat network [Connection]$Connection [hashtable]$Users = @{} [hashtable]$Rooms = @{} [System.Collections....
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/ConfigProvidedParameter.ps1
ConfigProvidedParameter.ps1
class ConfigProvidedParameter { [PoshBot.FromConfig]$Metadata [System.Management.Automation.ParameterMetadata]$Parameter ConfigProvidedParameter([PoshBot.FromConfig]$Meta, [System.Management.Automation.ParameterMetadata]$Param) { $this.Metadata = $Meta $this.Parameter = $param ...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/Person.ps1
Person.ps1
# Represents a person on a chat network class Person { [string]$Id # The identifier for the device or client the person is using [string]$ClientId [string]$Nickname [string]$FirstName [string]$LastName [string]$FullName [string]ToString() { return "$($this.id)...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/Connection.ps1
Connection.ps1
# This class represents the connection to a backend Chat network class Connection { [ConnectionConfig]$Config [ConnectionStatus]$Status = [ConnectionStatus]::Disconnected [void]Connect() {} [void]Disconnect() {} }
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/Logger.ps1
Logger.ps1
enum LogSeverity { Normal Warning Error } class LogMessage { [datetime]$DateTime = (Get-Date) [string]$Severity = [LogSeverity]::Normal [string]$LogLevel = [LogLevel]::Info [string]$Message [object]$Data LogMessage() { } LogMessage([string]$Message) { ...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/Event.ps1
Event.ps1
# An Event is something that happended on a chat network. A person joined a room, a message was received # Really any notification from the chat network back to the bot is considered an Event of some sort class Event { [string]$Type [string]$ChannelId [pscustomobject]$Data }
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/PoshBotAttribute.ps1
PoshBotAttribute.ps1
# Out custom attribute that external modules can decorate # command with. This controls the command behavior when imported # https://msdn.microsoft.com/en-us/library/84c42s56(v=vs.110).aspx Add-Type -TypeDefinition @" namespace PoshBot { public enum TriggerType { Command, Event, ...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/Card.ps1
Card.ps1
# A card is a special type of response with specific formatting class Card : Response { [string]$Summary [string]$Title [string]$FallbackText [string]$Link [string]$ImageUrl [string]$ThumbnailUrl [hashtable]$Fields }
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/ExceptionFormatter.ps1
ExceptionFormatter.ps1
class ExceptionFormatter { static [string]ToJson([System.Management.Automation.ErrorRecord]$Exception) { $props = @( @{l = 'CommandName'; e = {$_.InvocationInfo.MyCommand.Name}} @{l = 'Message'; e = {$_.Exception.Message}} @{l = 'Position'; e = {$_.InvocationInfo.P...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/Permission.ps1
Permission.ps1
class Permission { [string]$Name [string]$Plugin [string]$Description [bool]$Adhoc = $false Permission([string]$Name) { $this.Name = $Name } Permission([string]$Name, [string]$Plugin) { $this.Name = $Name $this.Plugin = $Plugin } Permission...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/Plugin.ps1
Plugin.ps1
# The Plugin class holds a collection of related commands that came # from a PowerShell module # Some custom exceptions dealing with plugins class PluginException : Exception { PluginException() {} PluginException([string]$Message) : base($Message) {} } class PluginNotFoundException : PluginException...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/Command.ps1
Command.ps1
# Some custom exceptions dealing with executing commands class CommandException : Exception { CommandException() {} CommandException([string]$Message) : base($Message) {} } class CommandNotFoundException : CommandException { CommandNotFoundException() {} CommandNotFoundException([string]$Messag...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/StorageProvider.ps1
StorageProvider.ps1
#requires -Modules Configuration class StorageProvider { [string]$ConfigPath StorageProvider() { $this.ConfigPath = (Join-Path -Path $env:USERPROFILE -ChildPath '.poshbot') } StorageProvider([string]$Dir) { $this.ConfigPath = $Dir } [hashtable]GetConfig([string...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/BotConfiguration.ps1
BotConfiguration.ps1
class BotConfiguration { [string]$Name = 'PoshBot' [string]$ConfigurationDirectory = (Join-Path -Path $env:USERPROFILE -ChildPath '.poshbot') [string]$LogDirectory = (Join-Path -Path $env:USERPROFILE -ChildPath '.poshbot') [string]$PluginDirectory = (Join-Path -Path $env:USERPROFILE -Child...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/Enums.ps1
Enums.ps1
# Some enums enum AccessRight { Allow Deny } enum ConnectionStatus { Connected Disconnected } enum TriggerType { Command Event Regex Timer } enum LogLevel { Info = 1 Verbose = 2 Debug = 4 }
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/Response.ps1
Response.ps1
enum Severity { Success Warning Error None } # A response message that is sent back to the chat network. class Response { [Severity]$Severity = [Severity]::Success [string[]]$Text [string]$MessageFrom [string]$To [pscustomobject[]]$Data = @() }
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/CommandParser.ps1
CommandParser.ps1
class ParsedCommand { [string]$CommandString [string]$Plugin = $null [string]$Command = $null [string[]]$Tokens = @() [hashtable]$NamedParameters = @{} [System.Collections.ArrayList]$PositionalParameters = (New-Object System.Collections.ArrayList) #[System.Management.Automation.Func...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/Room.ps1
Room.ps1
class Room { [string]$Id # The name of the room [string]$Name # The room topic [string]$Topic # Indicates if this room already exists or not [bool]$Exists # Indicates if this room has already been joined [bool]$Joined [hashtable]$Members = @{} Room(...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/Bot.ps1
Bot.ps1
class Bot { # Friendly name for the bot [string]$Name # The backend system for this bot (Slack, HipChat, etc) [Backend]$Backend hidden [string]$_PoshBotDir [StorageProvider]$Storage [PluginManager]$PluginManager [RoleManager]$RoleManager [CommandExecutor]$Exe...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/BotCommand.ps1
BotCommand.ps1
# This marks a class method as a bot command. When loading a plugin, the bot framework will # look for methods decorated with this attribute. These methods will be the commands exposed # to users of the bot # class BotCommand : Attribute { # [string]$Name # The name for the bot command # ...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Classes/ConnectionConfig.ps1
ConnectionConfig.ps1
# This class holds the bare minimum information necesary to establish a connection to a chat network. # Specific implementations MAY extend this class to provide more properties class ConnectionConfig { [string]$Endpoint [pscredential]$Credential ConnectionConfig() {} ConnectionConfig([s...
PowerShellCorpus/Github/GertaLeStrange_test2/PoshBot/Task/StartPoshBot.ps1
StartPoshBot.ps1
#requires -modules PoshBot [cmdletbinding()] param( [parameter(Mandatory)] [ValidateScript({ if (Test-Path -Path $_) { if ( (Get-Item -Path $_).Extension -eq '.psd1') { $true } else { Throw 'Path must be to a valid .psd1 file' ...
PowerShellCorpus/Github/GertaLeStrange_test2/Tests/Help.tests.ps1
Help.tests.ps1
# Taken with love from @juneb_get_help (https://raw.githubusercontent.com/juneb/PesterTDD/master/Module.Help.Tests.ps1) $outputDir = Join-Path -Path $ENV:BHProjectPath -ChildPath 'out' $outputModDir = Join-Path -Path $outputDir -ChildPath $env:BHProjectName $manifest = Import-PowerShellDataFile -Path $env:BHPSMo...
PowerShellCorpus/Github/GertaLeStrange_test2/Tests/Meta.tests.ps1
Meta.tests.ps1
Set-StrictMode -Version latest # Make sure MetaFixers.psm1 is loaded - it contains Get-TextFilesList Import-Module -Name (Join-Path -Path $PSScriptRoot -ChildPath 'MetaFixers.psm1') -Verbose:$false -Force $projectRoot = $ENV:BHProjectPath if(-not $projectRoot) { $projectRoot = $PSScriptRoot } Describe ...
PowerShellCorpus/Github/GertaLeStrange_test2/Tests/Manifest.tests.ps1
Manifest.tests.ps1
$moduleName = $env:BHProjectName $manifest = Import-PowerShellDataFile -Path $env:BHPSModuleManifest $outputDir = Join-Path -Path $ENV:BHProjectPath -ChildPath 'out' $outputModDir = Join-Path -Path $outputDir -ChildPath $env:BHProjectName $outputModVerDir = Join-Path -Path $outputModDir -ChildPath $manifest.Modul...
PowerShellCorpus/Github/bichdiep1802_AcronymDemoApp/gulpfile.js/AppxUtilities/Add-AppxPackageExt.ps1
Add-AppxPackageExt.ps1
<# .SYNOPSIS Install Appx packages. .DESCRIPTION A wrapper for Add-AppxPackage, this script additionally supports a Force switch that will install the package even when a package with the same package full name is already installed or if the package to install has an untrusted signature. Add...
PowerShellCorpus/Github/bichdiep1802_AcronymDemoApp/gulpfile.js/AppxUtilities/Launch-AppxPackageBackgroundTask.ps1
Launch-AppxPackageBackgroundTask.ps1
<# .SYNOPSIS Launch an Appx package's registered background task. .DESCRIPTION Given a background task id, launch the corresponding registered background task. .PARAMETER BackgroundTaskId The GUID of the registered background task to launch. This may be obtained by examining the BackgroundTa...
PowerShellCorpus/Github/bichdiep1802_AcronymDemoApp/gulpfile.js/AppxUtilities/Suspend-AppxPackage.ps1
Suspend-AppxPackage.ps1
<# .SYNOPSIS Suspend all running processes for a particular Appx package. .DESCRIPTION Suspend all running processes for a particular Appx package. .PARAMETER PackageFullNames The list of PackageFullNames of the Appx package's the processes of which should be acted upon. This is either a string o...
PowerShellCorpus/Github/bichdiep1802_AcronymDemoApp/gulpfile.js/AppxUtilities/Start.ps1
Start.ps1
$cwd = $args[0] $guid = $args[1] Write-Host $guid cd $cwd $installed = .\gulpfile.js\AppxUtilities\Get-AppxPackageExt.ps1 $guid if ($installed) { Remove-AppxPackage $installed.PackageFullName } $result = .\gulpfile.js\AppxUtilities\Add-AppxPackageExt.ps1 .\src\AppxManifest.xml $pfn = $result.Package.PackageFamil...
PowerShellCorpus/Github/bichdiep1802_AcronymDemoApp/gulpfile.js/AppxUtilities/Debug-AppxPackage.ps1
Debug-AppxPackage.ps1
<# .SYNOPSIS Debug appx packages. .DESCRIPTION A wrapper for plmdebug.exe, this script makes it easy to use plmdebug.exe in PowerShell with other AppxPackage commands. Returns the Get-AppxPackageExt results of the packages to which this command applied. .PARAMETER PackageFullNames This para...
PowerShellCorpus/Github/bichdiep1802_AcronymDemoApp/gulpfile.js/AppxUtilities/Get-ProcessAppxPackage.ps1
Get-ProcessAppxPackage.ps1
<# .SYNOPSIS Get Appx package info for running processes. .DESCRIPTION A wrapper for Get-Process, this script provides information about the running processes package identity and package execution state. .PARAMETER ProcessFilter Filter the output using this to match either process ID, proce...
PowerShellCorpus/Github/bichdiep1802_AcronymDemoApp/gulpfile.js/AppxUtilities/Get-AppxPackageExt.ps1
Get-AppxPackageExt.ps1
<# .SYNOPSIS Get installed Appx package information. .DESCRIPTION A wrapper for Get-AppxPackage, this script provides additional info beyond Get-AppxPackage's including: - DisplayName - Manifest parsed as XML - InstallLocation as file item - Application IDs - Registered ba...
PowerShellCorpus/Github/bichdiep1802_AcronymDemoApp/gulpfile.js/AppxUtilities/Launch-AppxPackage.ps1
Launch-AppxPackage.ps1
<# .SYNOPSIS Launch an installed Appx package's application. .DESCRIPTION Given an AppxPackage or PackageFamilyName and ApplicationId Launch-AppxPackage launches the application and provides as output the Get-ProcessAppxPackage result of the launched process. .PARAMETER PackageFamilyName The...
PowerShellCorpus/Github/bichdiep1802_AcronymDemoApp/gulpfile.js/AppxUtilities/Get-AppxPackageFile.ps1
Get-AppxPackageFile.ps1
<# .SYNOPSIS Get Appx package info from an Appx package file. .DESCRIPTION Given an Appx package file, Get-AppxPackageFile extracts the manifest from the file (using ExtractFromAppx.exe) and outputs the results of Get-AppxPackageExt filtered to packages with the same name as that in the mani...
PowerShellCorpus/Github/bichdiep1802_AcronymDemoApp/gulpfile.js/AppxUtilities/Resume-AppxPackage.ps1
Resume-AppxPackage.ps1
<# .SYNOPSIS Resume all suspended processes for a particular Appx package. .DESCRIPTION Resume all suspended processes for a particular Appx package. .PARAMETER PackageFullNames The list of PackageFullNames of the Appx package's the processes of which should be acted upon. This is either a string...
PowerShellCorpus/Github/bichdiep1802_AcronymDemoApp/gulpfile.js/AppxUtilities/Terminate-AppxPackage.ps1
Terminate-AppxPackage.ps1
<# .SYNOPSIS Terminate all processes for a particular Appx package. .DESCRIPTION Terminate all processes for a particular Appx package. .PARAMETER PackageFullNames The list of PackageFullNames of the Appx package's the processes of which should be acted upon. This is either a string or the result...
PowerShellCorpus/Github/craibuc_PsEnterpriseRest/Functions/Get-LogonToken.ps1
Get-LogonToken.ps1
function Get-LogonToken { [CmdletBinding()] param( [Parameter(Position = 0, Mandatory = $true)] [string]$ServerName, [Parameter(Position = 1, Mandatory = $true)] [ValidateSet("secEnterprise", "secLDAP", "secWinAD")] [string]$Authentication, [Parameter(Po...
PowerShellCorpus/Github/craibuc_PsEnterpriseRest/Functions/Get-LogonToken.Tests.ps1
Get-LogonToken.Tests.ps1
Import-Module PsEnterpriseRest -Force # $here = Split-Path -Parent $MyInvocation.MyCommand.Path # $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' # . "$here\$sut" Describe "Get-LogonToken" { # arrange $server = Read-Host "Enter server" $authentication = 'secWinAD' Con...
PowerShellCorpus/Github/craibuc_PsEnterpriseRest/Functions/Get-InfoObject.ps1
Get-InfoObject.ps1
<# .SUMMARY Query the infostore (AKA repository) and return a PsCustomObject representation of the resource(s) (AKA infoobjects). .PARAMETER $Token The token generated by Get-LogonToken. .PARAMETER $Token The path segment that identifies the resource(s). .EXAMPLE PS> $token = Get-LogonToken ... # get a...
PowerShellCorpus/Github/craibuc_PsEnterpriseRest/Functions/Get-InfoObject.Tests.ps1
Get-InfoObject.Tests.ps1
Import-Module PsEnterpriseRest -Force # $here = Split-Path -Parent $MyInvocation.MyCommand.Path # $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' # . "$here\$sut" Describe "Get-InfoObject" { # arrange $server = Read-Host "Enter server" $authentication = 'secWinAD' $usern...
PowerShellCorpus/Github/craibuc_PsEnterpriseRest/Functions/ConvertTo-PlainText.Tests.ps1
ConvertTo-PlainText.Tests.ps1
Import-Module PsEnterpriseRest -Force # $here = Split-Path -Parent $MyInvocation.MyCommand.Path # $sut = (Split-Path -Leaf $MyInvocation.MyCommand.Path) -replace '\.Tests\.', '.' # . "$here\$sut" Describe "ConvertTo-PlainText" { $expected = 'pa55w0rd' $securePassword = ConvertTo-SecureString -String $expect...
PowerShellCorpus/Github/craibuc_PsEnterpriseRest/Functions/ConvertTo-PlainText.ps1
ConvertTo-PlainText.ps1
<# .SUMMARY Convert an encrypted string ([System.Security.SecureString]) to its plain-text equivalent ([System.String]) .DESCRIPTION Convert an encrypted string ([System.Security.SecureString]) to its plain-text equivalent ([System.String]) .PARAMETER $SecureString The encrypted value to be converted. .EXA...
PowerShellCorpus/Github/toddrob_TR23MSM308/301-multi-vm-domain-join-ILB-build-dsc/AzureDeploymentPS.ps1
AzureDeploymentPS.ps1
# Login-AzureRmAccount #Variables $templatePath = $PSScriptRoot $TemplateFile = $templatePath + '\azuredeploy.json' $TemplateParameterFile = $templatePath + '\azuredeploy.parameters.json' $Location = 'East US 2' # Provide location for Deployment. IT should be West US ...
PowerShellCorpus/Github/toddrob_TR23MSM308/301-multi-vm-domain-join-ILB-build-dsc/scripts/Deploy-WinServer.ps1
Deploy-WinServer.ps1
Configuration DeployWinServer { param ( [string[]]$MachineName = $env:COMPUTERNAME ) Node localhost { cd\ if($(test-path -path c:\temp) -eq $false){ md Temp } Script NoOp { SetScript = { $sw = New-Object...
PowerShellCorpus/Github/toddrob_TR23MSM308/301-multi-vm-domain-join-ILB-build-dsc/scripts/FormatDataDisk.ps1
FormatDataDisk.ps1
configuration FormatDataDisks { param ( $Disks ) #$DiskArray = $Disks | convertfrom-Json $disks node localhost { Script FormatVolumnes { GetScript = { get-disk Get-Partition } ...
PowerShellCorpus/Github/toddrob_TR23MSM308/301-multi-vm-domain-join-ILB-build-dsc/scripts/Deploy-WebServer.ps1
Deploy-WebServer.ps1
Configuration DeployWebServer { param ( [string[]]$MachineName = "localhost" ) Node localhost { foreach ($Feature in @("Web-Server", ` "Web-App-Dev", ` "Web-Asp-Net45", ` "Web-Net-Ext45", ` ...
PowerShellCorpus/Github/toddrob_TR23MSM308/301-multi-vm-domain-join-ILB-build-dsc/scripts/Deploy-SQLServer.ps1
Deploy-SQLServer.ps1
Configuration DeploySQLServer { param ( [Parameter(Mandatory)] [string] $DataPath="H:\MSSqlServer\MSSQL\DATA", [Parameter(Mandatory)] [string] $LogPath="O:\MSSqlServer\MSSQL\DATA", [Parameter(Mandatory)] [string] $BackupPath="E:\MSSqlServer\MSSQL\DATA", [Parameter(Mandatory)] [st...
PowerShellCorpus/Github/toddrob_TR23MSM308/301-multi-vm-domain-join-ILB-build-dsc/scripts/DomainJoin.ps1
DomainJoin.ps1
configuration DomainJoin { param ( [Parameter(Mandatory)] [string] $Domain, [string] $ou, [Parameter(Mandatory)] [System.Management.Automation.PSCredential] $LocalAccount, [Parameter(Mandatory)] [System.Management.Automation.PSCredential] $Domain...
PowerShellCorpus/Github/diegoasf182_microsoft/Script/PowerShell/Hyper-V/CreatVMPowerShell.ps1
CreatVMPowerShell.ps1
Set-ExecutionPolicy Unrestricted Import-Module Hyper-V Write-Host "Variaveis de Entrada" $VMNAME = Read-Host "Digite o Nome da VM" $VMLocation = "C:\Users\Public\Documents\Hyper-V\Virtual hard disks\" $VMVLAN = Read-Host "Digite o Numero da VLAN" $VMVHD = "$VMLocation\$VMNAME\${VMNAME}_OS_C_Drive.VHDX" $VHTEMPLA...
PowerShellCorpus/Github/diegoasf182_microsoft/Script/PowerShell/NanoServer/New-NanoServerVHD.ps1
New-NanoServerVHD.ps1
<# .SYNOPSIS Creates a bootable VHD/VHDx containing Windows Server Nano 2016. .DESCRIPTION Creates a bootable VHD/VHDx containing Windows Server Nano 2016 using the publically available Windows Server 2016 Technical Preview 4 ISO. This script needs the Convert-WindowsImage.ps1 script to be in the sa...
PowerShellCorpus/Github/diegoasf182_microsoft/Script/PowerShell/AD/Get-SPN.ps1
Get-SPN.ps1
function Get-SPN { <# .SYNOPSIS Get Service Principal Names .DESCRIPTION Get Service Principal Names Output includes: ComputerName - SPN Host Specification - SPN Port (or Instance) ServiceClass - SPN Service Class (MSSQLSvc, HTTP, etc.) ...
PowerShellCorpus/Github/diegoasf182_microsoft/Script/PowerShell/AD/Password Change Notification.ps1
Password Change Notification.ps1
################################################################################################################# # # Version 1.4 February 2016 # Robert Pearman (WSSMB MVP) # TitleRequired.com # Script to Automated Email Reminders when Users Passwords due to Expire. # # Requires: Windows PowerShell Module for A...
PowerShellCorpus/Github/diegoasf182_microsoft/Script/PowerShell/AD/fpw_campos.ps1
fpw_campos.ps1
#Add-Type -Path "C:\oracle\odp.net\managed\common\Oracle.ManagedDataAccess.dll" Add-Type -Path "E:\APPSAR\Oracle\odp.net\managed\common\Oracle.ManagedDataAccess.dll" $connectionString = "Data Source=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(Host=172.27.0.168)(Port=1521)))(CONNECT_DATA=(SID=FPW)));User ID...
PowerShellCorpus/Github/diegoasf182_microsoft/Script/PowerShell/AD/disableaccounts.ps1
disableaccounts.ps1
$FILEPATH = "C:\Users\diegoas.SARAIVA\Desktop\emailZ.csv" $Stuff = Import-Csv $FILEPATH $Result = ForEach ($Name in $Stuff){ $T= $Name.Email Get-ADUser -Identity $T -Properties LastLogonDate,Enabled,Department,Description,EmployeeID,SamAccountName } $accountenable = $Result | Where-Object {$_.Enabled -like "tru...
PowerShellCorpus/Github/diegoasf182_microsoft/Script/PowerShell/AD/Move and disable inactive computer accounts.ps1
Move and disable inactive computer accounts.ps1
#Script used to fiund all accounts ahwihc are inactive in Active Directory and move them to a specific OU and disable them #Customise the script with the source serach OU and desitnation OU to move the accounts, and specify the number of days the computer #must have been inactive for - suggested value is 60 days. ...
PowerShellCorpus/Github/diegoasf182_microsoft/Script/PowerShell/AD/ajusta_ad_por_usuario.ps1
ajusta_ad_por_usuario.ps1
Import-Module ActiveDirectory $odpnet="C:\oracle\odp.net\managed\common\Oracle.ManagedDataAccess.dll" If (Test-Path $odpnet){ # // File exists Add-Type -Path $odpnet } else { $odpnet="E:\APPSAR\Oracle\odp.net\managed\common\Oracle.ManagedDataAccess.dll" If (Test-Path $odpnet){ # // File exis...
PowerShellCorpus/Github/diegoasf182_microsoft/Script/PowerShell/AD/ScriptAD_PDV_v1.ps1
ScriptAD_PDV_v1.ps1
Set-ExecutionPolicy Unrestricted Import-Module ActiveDirectory ################################################################################ Write-Host "Variaveis de Entrada" [int]$NumberLOJA = Read-Host "Digite o Numero da Loja com 3 digitos Ex(050)" $NameLoja = Read-Host "Digite o Nome da Loja Ex:(Analia ...
PowerShellCorpus/Github/diegoasf182_microsoft/Script/PowerShell/AD/manutencao_caixas_online.ps1
manutencao_caixas_online.ps1
import-module activedirectory $UserCredential = Get-Credential $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell-liveid/ -Credential $UserCredential -Authentication Basic -AllowRedirection Import-PSSession $Session # Lista usuarios que foram m...
PowerShellCorpus/Github/diegoasf182_microsoft/Script/PowerShell/Desktop/Delinc.ps1
Delinc.ps1
##################################################### <# .SYNOPSIS Script do remove files in Startup Folder running with Windows 7 .DESCRIPTION The script removes files that are inside the User folder initializing , running windows 7 .NOTES Name: CleanFolderStartup.ps1 Author: Diego Alves da...
PowerShellCorpus/Github/diegoasf182_microsoft/Script/PowerShell/Desktop/CleanFolderStartup.ps1
CleanFolderStartup.ps1
##################################################### <# .SYNOPSIS Script do remove files in Startup Folder running with Windows 7 .DESCRIPTION The script removes files that are inside the User folder initializing , running windows 7 .NOTES Name: CleanFolderStartup.ps1 Author: Diego Alves da...
PowerShellCorpus/Github/diegoasf182_microsoft/Script/PowerShell/Desktop/Set-ADAccountasLocalAdministratorPT.ps1
Set-ADAccountasLocalAdministratorPT.ps1
<# .SYNOPSIS Script to add an AD User or group to the Local Administrator group .DESCRIPTION The script can use either a plaintext file or a computer name as input and will add the trustee (user or group) as an administrator to the computer .PARAMETER InputFile A path that contains a plaintext file w...
PowerShellCorpus/Github/diegoasf182_microsoft/Script/PowerShell/Desktop/Set-ADAccountasLocalAdministrator.ps1
Set-ADAccountasLocalAdministrator.ps1
<# .SYNOPSIS Script to add an AD User or group to the Local Administrator group .DESCRIPTION The script can use either a plaintext file or a computer name as input and will add the trustee (user or group) as an administrator to the computer .PARAMETER InputFile A path that contains a plaintext file w...
PowerShellCorpus/Github/diegoasf182_microsoft/Script/PowerShell/Desktop/Add-LHSPrinterPermissionSDDL (1).ps1
Add-LHSPrinterPermissionSDDL (1).ps1
Function Add-LHSPrinterPermissionSDDL { <# .SYNOPSIS Add Printer Permission using SDDL .DESCRIPTION Add Printer Permission using Security Definition Description Language (SDDL). The function adds full controll rights to the SDDL Use Get-Printer and Set-Printer to modify Printer Permission on...
PowerShellCorpus/Github/diegoasf182_microsoft/Script/PowerShell/Desktop/Add-LHSPrinterPermissionSDDL.ps1
Add-LHSPrinterPermissionSDDL.ps1
Function Add-LHSPrinterPermissionSDDL { <# .SYNOPSIS Add Printer Permission using SDDL .DESCRIPTION Add Printer Permission using Security Definition Description Language (SDDL). The function adds full controll rights to the SDDL Use Get-Printer and Set-Printer to modify Printer Permission on...
PowerShellCorpus/Github/diegoasf182_microsoft/Script/PowerShell/Profile/Microsoft.PowerShell_profile.ps1
Microsoft.PowerShell_profile.ps1
$env:PATH="C:/opscode/chefdk/bin;C:/Users/adm.diegoas/AppData/Local/chefdk/gem/ruby/2.1.0/bin;C:/opscode/chefdk/embedded/bin;C:/opscode/chefdk/bin;C:/Users/adm.diegoas/AppData/Local/chefdk/gem/ruby/2.1.0/bin;C:/opscode/chefdk/embedded/bin;C:/opscode/chefdk/bin;C:/Users/adm.diegoas/AppData/Local/chefdk/gem/ruby/2.1.0/bi...
PowerShellCorpus/Github/diegoasf182_microsoft/Script/PowerShell/Chef/installchefservidores.ps1
installchefservidores.ps1
knife bootstrap windows winrm 10.245.240.100 -N SRVCAJDC01.saraiva.corp -E prod --winrm-user saraiva.corp\svc_pwsh --winrm-password ProG0x78$ --bootstrap-proxy http://srvtmgcaj.saraiva.corp:8080 knife bootstrap windows winrm 10.245.240.101 -N SRVCAJDC02.saraiva.corp -E prod --winrm-user saraiva.corp\svc_pwsh --winrm-p...
PowerShellCorpus/Github/diegoasf182_microsoft/Script/PowerShell/Chef/installcheflojas.ps1
installcheflojas.ps1
knife bootstrap windows winrm 10.3.61.251 -N L006NT01.saraiva.corp -E prod --winrm-user saraiva.corp\svc_pwsh --winrm-password ProG0x78$ --bootstrap-proxy http://proxy.saraiva.corp:3128 knife bootstrap windows winrm 10.3.61.252 -N L006NT02.saraiva.corp -E prod --winrm-user saraiva.corp\svc_pwsh --winrm-password ProG...
PowerShellCorpus/Github/OPSTest_E2E_NewRepo_1488339314214/.openpublishing.build.ps1
.openpublishing.build.ps1
param( [string]$buildCorePowershellUrl = "https://opbuildstoragesandbox2.blob.core.windows.net/opps1container/.openpublishing.buildcore.ps1", [string]$parameters ) # Main $errorActionPreference = 'Stop' # Step-1: Download buildcore script to local echo "download build core script to local with source u...
PowerShellCorpus/Github/mwinkler_Playground/NetCoreConsole/DockerTask.ps1
DockerTask.ps1
<# .SYNOPSIS Deploys an ASP .NET Core Web Application into a docker container running in a specified Docker machine. .DESCRIPTION The following script will execute a set of Docker commands against the designated dockermachine. .PARAMETER Build Builds the containers using docker-compose build. .PARAMETER Cl...
PowerShellCorpus/Github/mwinkler_Playground/NetCoreConsole/Properties/PublishProfiles/default-publish.ps1
default-publish.ps1
[cmdletbinding(SupportsShouldProcess=$true)] param($publishProperties=@{}, $packOutput, $pubProfilePath) # to learn more about this file visit https://go.microsoft.com/fwlink/?LinkId=524327 try{ if ($publishProperties['ProjectGuid'] -eq $null){ $publishProperties['ProjectGuid'] = '991ffc61-0c4b-4c7...
PowerShellCorpus/Github/vandsh_sitecore-itemizer/tds-to-content.ps1
tds-to-content.ps1
<# Script to run across all items in a project and create the associated assets #> $tdsSourceProject = "TDSProject"; $tdsSourceProjectDirectory = ("$PSScriptRoot\..\{0}\" -f $tdsSourceProject); Get-ChildItem -Path $tdsSourceProjectDirectory -Recurse -Include *.item | % { & .\parse-item-and-write.ps1 $_.FullNa...
PowerShellCorpus/Github/vandsh_sitecore-itemizer/parse-item-and-write.ps1
parse-item-and-write.ps1
<# Parses a .item file, grabs the fields defined below (right now just the blob field) and creates/updates the corresponding decoded asset in the specified destination directory $itemPath/sitecore/assets/css_asset.item -> $destinationDirectory/css_asset.css (based on the Extension defined in the item) ...
PowerShellCorpus/Github/vandsh_sitecore-itemizer/parse-content-and-itemize.ps1
parse-content-and-itemize.ps1
<# Parses a .css/.js/.jpg file, grabs the content and encodes it. Then inserts it into the associated .item (into the blob field) in the destination directory $assetRoot/sitecore/assets/css_asset.css -> $destinationDirectory/css_asset.item Example usage: .\parse-content-and-itemize.ps1 "project...
PowerShellCorpus/Github/JeetendraAdhikari_GitAppTest/GitApp/packages/jQuery.1.10.2/Tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # Determine the file paths $projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName $origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName if (Test-Path $projectIntelliSense...
PowerShellCorpus/Github/JeetendraAdhikari_GitAppTest/GitApp/packages/jQuery.1.10.2/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # VS 11 and above supports the new intellisense JS files $vsVersion = [System.Version]::Parse($dte.Version) $supportsJsIntelliSenseFile = $vsVersion.Major -ge 11 if (-not $supportsJsIntelliSenseFile) { $displayVersio...
PowerShellCorpus/Github/JeetendraAdhikari_GitAppTest/GitApp/packages/jQuery.1.10.2/Tools/common.ps1
common.ps1
function Get-Checksum($file) { $cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider" $fileInfo = Get-Item $file trap { ; continue } $stream = $fileInfo.OpenRead() if ($? -eq $false) { # Couldn't open file for reading return $null } $bytes = $...
PowerShellCorpus/Github/JeetendraAdhikari_GitAppTest/GitApp/packages/EntityFramework.6.0.0/tools/init.ps1
init.ps1
param($installPath, $toolsPath, $package, $project) if (Get-Module | ?{ $_.Name -eq 'EntityFramework' }) { Remove-Module EntityFramework } Import-Module (Join-Path $toolsPath EntityFramework.psd1) # SIG # Begin signature block # MIIarwYJKoZIhvcNAQcCoIIaoDCCGpwCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB # gjcCAQ...
PowerShellCorpus/Github/JeetendraAdhikari_GitAppTest/GitApp/packages/EntityFramework.6.0.0/tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) Initialize-EFConfiguration $project Add-EFProvider $project 'System.Data.SqlClient' 'System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer' Write-Host Write-Host "Type 'get-help EntityFramework' to see all available Entity Framework comma...
PowerShellCorpus/Github/JeetendraAdhikari_GitAppTest/GitApp/packages/Modernizr.2.6.2/Tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # Update the _references.js file Remove-Reference $scriptsFolderProjectItem $modernizrFileNameRegEx
PowerShellCorpus/Github/JeetendraAdhikari_GitAppTest/GitApp/packages/Modernizr.2.6.2/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) if ($scriptsFolderProjectItem -eq $null) { # No Scripts folder Write-Host "No Scripts folder found" exit } # Update the _references.js file AddOrUpdate-Reference $scriptsFolderProjectItem $modernizrFileName...
PowerShellCorpus/Github/JeetendraAdhikari_GitAppTest/GitApp/packages/Modernizr.2.6.2/Tools/common.ps1
common.ps1
function AddOrUpdate-Reference($scriptsFolderProjectItem, $fileNamePattern, $newFileName) { try { $referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js") } catch { # _references.js file not found return } if ($referencesFileProject...
PowerShellCorpus/Github/Schittecatte_PeopleManager-oef-7/PeopleManager/packages/jQuery.1.10.2/Tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # Determine the file paths $projectIntelliSenseFilePath = Join-Path $projectScriptsFolderPath $intelliSenseFileName $origIntelliSenseFilePath = Join-Path $toolsPath $intelliSenseFileName if (Test-Path $projectIntelliSense...
PowerShellCorpus/Github/Schittecatte_PeopleManager-oef-7/PeopleManager/packages/jQuery.1.10.2/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # VS 11 and above supports the new intellisense JS files $vsVersion = [System.Version]::Parse($dte.Version) $supportsJsIntelliSenseFile = $vsVersion.Major -ge 11 if (-not $supportsJsIntelliSenseFile) { $displayVersio...
PowerShellCorpus/Github/Schittecatte_PeopleManager-oef-7/PeopleManager/packages/jQuery.1.10.2/Tools/common.ps1
common.ps1
function Get-Checksum($file) { $cryptoProvider = New-Object "System.Security.Cryptography.MD5CryptoServiceProvider" $fileInfo = Get-Item $file trap { ; continue } $stream = $fileInfo.OpenRead() if ($? -eq $false) { # Couldn't open file for reading return $null } $bytes = $...
PowerShellCorpus/Github/Schittecatte_PeopleManager-oef-7/PeopleManager/packages/Modernizr.2.6.2/Tools/uninstall.ps1
uninstall.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) # Update the _references.js file Remove-Reference $scriptsFolderProjectItem $modernizrFileNameRegEx
PowerShellCorpus/Github/Schittecatte_PeopleManager-oef-7/PeopleManager/packages/Modernizr.2.6.2/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) . (Join-Path $toolsPath common.ps1) if ($scriptsFolderProjectItem -eq $null) { # No Scripts folder Write-Host "No Scripts folder found" exit } # Update the _references.js file AddOrUpdate-Reference $scriptsFolderProjectItem $modernizrFileName...
PowerShellCorpus/Github/Schittecatte_PeopleManager-oef-7/PeopleManager/packages/Modernizr.2.6.2/Tools/common.ps1
common.ps1
function AddOrUpdate-Reference($scriptsFolderProjectItem, $fileNamePattern, $newFileName) { try { $referencesFileProjectItem = $scriptsFolderProjectItem.ProjectItems.Item("_references.js") } catch { # _references.js file not found return } if ($referencesFileProject...
PowerShellCorpus/Github/Schittecatte_PeopleManager-oef-7/PeopleManager/packages/Microsoft.ApplicationInsights.WindowsServer.2.2.0/Tools/install.ps1
install.ps1
param($installPath, $toolsPath, $package, $project) if ([System.IO.File]::Exists($project.FullName)) { function MarkItemASCopyToOutput($item) { Try { #mark it to copy if newer $item.Properties.Item("CopyToOutputDirectory").Value = 2 } Catch { write-host $_.Exception.ToString() }...
PowerShellCorpus/Github/Schittecatte_PeopleManager-oef-7/PeopleManager/packages/Microsoft.Web.Infrastructure.1.0.0.0/tools/Install.ps1
Install.ps1
param($installPath, $toolsPath, $package, $project) if ($project.Type -eq 'Web Site') { Import-Module (Join-Path $toolsPath VS.psd1) $srcFiles = Join-Path $installPath "lib\net40\*.dll" $projectRoot = Get-ProjectRoot $project if (!$projectRoot) { return; } $destDirec...