filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
1215.ps1 |
$Path = $null
$user = 'CarbonGrantPerms'
$containerPath = $null
$privateKeyPath = Join-Path -Path $PSScriptRoot -ChildPath 'Cryptography\CarbonTestPrivateKey.pfx' -Resolve
& (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve)
$credential = New-Credential -UserName $user -Passwor... | 0 |
Get-TheVillageChurchPod.ps1 | function Get-TheVillageChurchPodCast {
<#
.SYNOPSIS
Gets The Village Church sermon podcasts.
.DESCRIPTION
The Get-TheVillageChurchPodcast function returns objects of all the available sermon podcasts from The Village Church.
The objects can be filtered by speaker, series, title, or date and optionally d... | 0 |
DriveSpace_1.format.ps1xml.ps1 | <?xml version="1.0" encoding="utf-8" ?>
<Configuration>
<ViewDefinitions>
<View>
<Name>SpaceGraph</Name>
<ViewSelectedBy>
<TypeName>System.Management.ManagementObject#root\\cimv2\\Win32_LogicalDisk</TypeName>
</ViewSelectedBy>
<WideControl>
... | 0 |
185.ps1 |
$childWI_ReviewerActivityHasReviewers_Class_id = '6e05d202-38a4-812e-34b8-b11642001a80'
$childWI_ReviewerActivityHasReviewers_Class_obj = Get-SCSMRelationshipClass -id $childWI_ReviewerActivityHasReviewers_Class_id
$childWI_ReviewerisUser_Class_id = '90da7d7c-948b-e16e-f39a-f6e3d1ffc921'
$childWI_ReviewerisUser_Cla... | 0 |
New-FilesystemHardLink.p.ps1 | ##############################################################################\n##\n## New-FileSystemHardLink\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\n<#\n\n.SYNOPSIS\n\nC... | 0 |
Get-MemoryChart.ps1 | #.Synopsis
# Draw pie charts of server memory usage by process
#.Description
# Uses PowerBoots to draw a pipe-chart of each computer's memory use. While you wait for that information
# to be gathered, it shows you the latest xkcd comic. ##DEPEND-ON -Function Get-Comic
# Uses the Transitionals library for nic... | 0 |
3332.ps1 |
function Remove-GroupUser {
[PoshBot.BotCommand(
Permissions = 'manage-groups'
)]
[cmdletbinding()]
param(
[parameter(Mandatory)]
$Bot,
[parameter(Mandatory, Position = 0)]
[string]$Group,
[parameter(Mandatory, Position = 1)]
[string]$User
... | 0 |
sample_21_98.ps1 | ConvertFrom-StringData @'
IPAddressDisplayNameFormat=Endereço IP: {0}
NetworkNameDisplayNameFormat=Nome: {0}
NetworkNameOfflineDisplayNameFormat=Endereço IP: Endereço em "{0}"
CreateClusterProgressValidationStart=A validar adequação dos servidores para um cluster de ativação pós-falha.
CreateClusterProgressValidat... | 0 |
Test-CommandValidation.ps1 | #############################################################
#
# PS II> Test-CommandValidation -command get-process | fl
# VerbNounConvention : True
# ReservedKeyWords : True
# VerbConvention : True
#
# author: Walid Toumi
################################################... | 0 |
3155.ps1 | function Format-BranchName {
param(
[string]
$branchName
)
if($spg.BranchNameLimit -gt 0 -and $branchName.Length -gt $spg.BranchNameLimit) {
$branchName = ' {0}{1} ' -f $branchName.Substring(0, $spg.BranchNameLimit), $spg.TruncatedBranchSuffix
}
return " $branchName "
}
fun... | 0 |
Get-Credential 2.3.ps1 | ## Get-Credential
## An improvement over the default cmdlet which has no options ...
###################################################################################################
## History
## v 2.3 Add -Store switch and support putting credentials into the file system
## v 2.1 Fix the comment help and para... | 0 |
sample_2_69.ps1 | ConvertFrom-StringData @'
id_sccm_activity_cm07serverinfo=Gathering Site Server Information
id_sccm_cm07serverinfo_serverinfo=Obtaining Site Server Information
id_sccm_cm07serverinfo_hierarchy=Obtaining Site Hierarchy
id_sccm_cm07serverinfo_filever=Obtaining File Versions
'@
# SIG # Begin signature block
# MII... | 0 |
sample_21_28.ps1 | @{
GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF"
Author="PowerShell"
CompanyName="Microsoft Corporation"
Copyright="Copyright (c) Microsoft Corporation."
ModuleVersion="7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion="3.0"
FunctionsToExport = @()
CmdletsToExport="Start-Transcript", "Stop-Transcript"
AliasesTo... | 0 |
sample_10_29.ps1 | #************************************************
# TS_ServicingCorruptionCheck.ps1
# Version 1.0.1
# Date: 12/28/2012
# Author: v-kaw
# Description: [Idea ID 5712] [Windows] Run Dism checkhealth on Win8 or 2012 to detect possible servicing corruption
# Rule number: 5712
# Rule URL: http://sharepoint/sites/ru... | 0 |
sample_8_53.ps1 | #************************************************
# DC_ChkSym_DPM.ps1
# Version 1.0.0
# Date: 12-07-2010
# Author: Patrick Lewis - patlewis@microsoft.com
# Description: This script calls chksym to get file version information from DPM files and other files
#************************************************
PARAM(... | 0 |
sample_17_10.ps1 | #
# Module manifest for module 'OCI.PSModules.Dts'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dts.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
sample_57_62.ps1 | <#
.Synopsis
Activate a Python virtual environment for the current PowerShell session.
.Description
Pushes the python executable for a virtual environment to the front of the
$Env:PATH environment variable and sets the prompt to signify that you are
in a Python virtual environment. Makes use of the command line... | 0 |
Get-MIX10Video.ps1 | #requires -version 2.0
PARAM (
[Parameter(Position=1, Mandatory=$true)]
[ValidateSet("wmv","wmvhigh","ppt", "mp4")]
[String]$MediaType,
[string]$Destination = $PWD
)
if( ([System.Environment]::OSVersion.Version.Major -gt 5) -and -not ( # Vista and ...
new-object Security.Principal.WindowsPrinci... | 0 |
VM Disk Report_2.ps1 | $VMs = get-vm
$Results = @()
foreach ($VM in $VMs) {
$Result = new-object PSObject
$Result | add-member -membertype NoteProperty -name "Name" -value $VM.Name
$Result | add-member -membertype NoteProperty -name "Description" -value $VM.Notes
$VMDiskCount = 1
get-harddisk $VM | foreach {
... | 0 |
a706909d-64de-4e36-abce-4f3cc5441fde.ps1 | $vm = get-vm testvm
$ds = $vm | get-datastore
move-vm -VM $vm -Destination (get-vmhost MyDestination) -Datastore $ds
| 0 |
2386.ps1 | function New-PodcastEpisode
{
[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[ValidateScript({ Test-Path -Path $_ -PathType Leaf })]
[string]$RssFilePath,
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$Title,
[Parameter(Mandatory)]
[ValidateNotNullOrEmp... | 0 |
Test-VM_2.ps1 | Function Test-VM
{
[cmdletbinding()]
Param
(
[Parameter(Mandatory=$true,Position=1)]
[string[]]$Name,
[Parameter(Mandatory=$true,Position=2)]
[string[]]$ComputerName
)
Process
{
$results = @()
foreach ($cName in $ComputerName) {
... | 0 |
Get-MACFromIP.ps1 | Function Get-MACFromIP {
param ($IPAddress)
$sign = @"
using System;
using System.Collections.Generic;
using System.Text;
using System.Net;
using System.Net.NetworkInformation;
using System.Runtime.InteropServices;
public static class NetUtils
{
[System.Runtime.InteropServices.DllImport("iphlpapi.dll... | 0 |
1300.ps1 |
function Install-CGroup
{
[CmdletBinding(SupportsShouldProcess=$true)]
[OutputType([DirectoryServices.AccountManagement.GroupPrincipal])]
param(
[Parameter(Mandatory=$true)]
[string]
$Name,
[string]
$Description = '',
... | 0 |
usr ActiveSync - Exch 07.ps1 | #Sacamos los dispositivos asociados a cada mailbox
#Verificamos su ultima conexión o si alguna vez no se han conectado
#Autor: Pedro Genil
#Fecha:23/11/2012
#Version: 1.0
If ((Get-PSSnapin | where {$_.Name -match "Exchange.Management"}) -eq $null)
{
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin
}... | 0 |
Newer-LinkedClone.ps1 | #Requires -version 2
# TITLE: Newer-LinkedClone.ps1
# AUTHOR: Cameron Smith (original by Hal Rottenberg)
# Adapted from a technique published originally by Keshav Attrey http://www.vmdev.info/?p=40
# Also see William Lam's Perl script: http://engineering.ucsb.edu/~duonglt/vmware/vGhettoLinkedClone.html
# And Le... | 0 |
sample_44_52.ps1 | #
# Script module for module 'Az.DataProtection' that is executed when 'Az.DataProtection' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 04/23/2024 13:01:40
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
... | 0 |
Get-WebSite_7.ps1 | function Get-WebSite {
<#
.SYNOPSIS
Retrieves information about a website.
.DESCRIPTION
Retrieves information about a website.
.PARAMETER Url
URL of the website to test access to.
.PARAMETER UseDefaultCredentials
Use the currently authenticated user's credentials
.PARAMETER Proxy
Us... | 0 |
2487.ps1 |
[CmdletBinding(DefaultParameterSetName = 'name')]
[OutputType('System.Management.Automation.PSCustomObject')]
param (
[Parameter(ParameterSetName = 'name',
Mandatory,
ValueFromPipeline,
ValueFromPipelineByPropertyName)]
[ValidateSet("Tom","Dick","Jane")]
[ValidateRange(21,65)]
[ValidateScript({Test-Path $_ -... | 0 |
Get-DesktopResolution.ps.ps1 | <#
.SYNOPSIS
Displays Desktop Size
.DESCRIPTION
This script is a re-write of an MSDN sample. It uses
the Win32_Desktop Monitor WMI class to obtain the
screen dimensions.
.NOTES
File Name : Get-DesktopResolution.ps1
Author : Thomas Lee - tfl@psp.co.uk
Requires : PowerShell V2 CTP3... | 0 |
2794.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT
COUNT(ProcessName) as ct,
ProcessName
FROM
*ProcsWMI.tsv
GROUP BY
ProcessName
ORDER BY
ct ASC
"@
& logparser -stats:off -i:csv -dtlines:0 -fixedsep:on -rtp:-1 "$lpquery"
} else {
$ScriptName = [... | 0 |
271.ps1 | function ConvertFrom-Base64
{
[CmdletBinding()]
PARAM (
[parameter(Mandatory = $true, ValueFromPipeline)]
[String]$String
)
TRY
{
Write-Verbose -Message "[ConvertFrom-Base64] Converting String"
[System.Text.Encoding]::Default.GetString(
[System.Convert]::... | 0 |
sample_52_57.ps1 | # Use the PowerShell extension setting `powershell.scriptAnalysis.settingsPath` to get the current workspace
# to use this PSScriptAnalyzerSettings.psd1 file to configure code analysis in Visual Studio Code.
# This setting is configured in the workspace's `.vscode/settings.json`.
#
# For more information on PSScrip... | 0 |
sample_39_17.ps1 | param (
$FilePath,
$AllowContent=$False
)
. "$PSScriptRoot\..\project\api.ps1"
. "$PSScriptRoot\api.ps1"
$FullPath = Get-Full-Path($FilePath)
$dbInfo = Get-Database-Info
Configure-MySQL
if ($dbInfo.type -eq "mysql") {
$database = $dbInfo.database;
$login = $dbInfo.login
$env:MYSQL_... | 0 |
sample_7_21.ps1 | #************************************************
# TS_PrintCSRBloatingCheck.ps1
# Version 1.0.1
# Date: 6/26/2012
# Author: v-maam
# Description: [Idea ID 2374] [Windows] Spooler service hangs since CSR exhausts the 512 threads in thread pool
# Rule number: 2374
# Rule URL: http://sharepoint/sites/rules/Rule... | 0 |
sample_27_59.ps1 |
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# 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 Licen... | 0 |
339.ps1 | function Get-PSFConfig
{
[OutputType([PSFramework.Configuration.Config])]
[CmdletBinding(DefaultParameterSetName = "FullName", HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Get-PSFConfig')]
Param (
[Parameter(ParameterSetName = "FullName", Position = 0)]
[string]
$FullName = "*",
... | 0 |
sample_47_78.ps1 | #region C# code
$FolderHashSource = @"
using System;
using System.Collections.Generic;
using System.IO;
using System.Runtime.Serialization.Formatters.Binary;
namespace Microsoft.Solutions.IO
{
[Serializable]
public class FolderHashEntry : IEquatable<FolderHashEntry>
{
public string Path... | 0 |
sample_51_16.ps1 | <#############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
#############################################################>
... | 0 |
2818.ps1 |
if (Get-Command logparser.exe) {
$lpquery = @"
SELECT
COUNT(ImagePath, LaunchString, Publisher) as ct,
ImagePath,
LaunchString,
Publisher
FROM
*autorunsc.tsv
WHERE
(ImagePath not like 'File not found%')
GROUP BY
ImagePath,
LaunchStri... | 0 |
Bootstrap psake w_ PsGet_1.ps1 | # Get-MyModule adapted from http://blogs.technet.com/b/heyscriptingguy/archive/2010/07/11/hey-scripting-guy-weekend-scripter-checking-for-module-dependencies-in-windows-powershell.aspx
function Get-MyModule {
param ([string] $name)
write-host "Is '$name' already imported? " -NoNewline -ForegroundColor Cyan
... | 0 |
sample_41_96.ps1 |
///////////////////////////////////////////////////////////////////////////////
// Helper to set a designer prop
///////////////////////////////////////////////////////////////////////////////
function setDesignerProp(tname, ttype, tvalue) {
var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0)... | 0 |
3479.ps1 |
function Test-CreateSqlVirtualMachineGroup
{
$location = Get-LocationForTest
$rg = Create-ResourceGroupForTest $location
$groupName = Get-SqlVirtualMachineGroupName
$previousErrorActionPreferenceValue = $ErrorActionPreference
$ErrorActionPreference = "SilentlyContinue"
try
{
$group = Crea... | 0 |
sample_13_50.ps1 | param (
[string]$command="install"
)
Write-Output "Command=" $command
function Install(){
# state the install command here (notice: all source are inside "\bin" folder. here is the example
$PathToSelf = Split-Path -Path $PSCommandPath -Parent
Push-Location $PathToSelf -Verbose
Start-Process -... | 0 |
3616.ps1 |
function Test-AddAzureRmAutoscaleSetting
{
$resourceId = "/subscriptions/b67f7fec-69fc-4974-9099-a26bd6ffeda3/resourceGroups/TestingMetricsScaleSet/providers/Microsoft.Compute/virtualMachineScaleSets/testingsc"
$resourceGroup = "TestingMetricsScaleSet"
$rule1 = New-AzAutoscaleRule -Metri... | 0 |
sample_62_66.ps1 | #
# Module manifest for module 'OCI.PSModules.Healthchecks'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Healthchecks.dll'
# Version number of this module.
ModuleVersion = '86.0.0'
# Supported PSEditi... | 0 |
sample_50_95.ps1 | ###
# ==++==
#
# Copyright (c) Microsoft Corporation. All rights reserved.
# 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.apache.org/licenses/LICENSE-2.0
#
# Unless requi... | 0 |
sample_51_76.ps1 | @{
IncludeRules=@('PSDSC*')
}
# SIG # Begin signature block
# MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCB4py8/3f6n2koR
# USF+SZkmUhBEJfwl8TGS1Tis3232TKCCDXYwggX0MIID3KAD... | 0 |
sample_30_65.ps1 | #
# Module manifest for module 'OCI.PSModules.Datalabelingservicedataplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Datalabelingservicedataplane.dll'
# Version number of this module.
ModuleVersion... | 0 |
HttpRest 1.2.ps1 | #requires -version 2.0
## HttpRest module version 1.2
####################################################################################################
## Still only the initial stages of converting to a full v2 module
## Based on the REST api from MindTouch's Dream SDK
##
## INSTALL:
## You need mindtouch.dr... | 0 |
sample_44_13.ps1 | #
# Module manifest for module 'OCI.PSModules.Servicecatalog'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Servicecatalog.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSE... | 0 |
sample_33_40.ps1 | /*!---------------------------------------------------------
* Copyright (C) Microsoft Corporation. All rights reserved.
*----------------------------------------------------------*/
module.exports = {
isInstalled: function () { return false; }
};
// SIG // Begin signature block
// SIG // MIIatwYJKoZIhvc... | 0 |
sample_61_15.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
function Publish-NewServiceFa... | 0 |
4454.ps1 |
Register-PSRepository -PSGallery
<<<<<<< HEAD
Register-PSResourceRepository 'TestRepo' 'www.testrepo.com'
Register-PSResourceRepository -name 'TestRepo' -url 'www.testrepo.com'
Register-PSResourceRepository -name 'TestRepo' -url 'www.testrepo.com' -Trusted
Register-PSResourceRepository -name 'TestRepo' -url... | 0 |
1852.ps1 |
Describe "Job Cmdlet Tests" -Tag "CI" {
Context "Simple Jobs" {
BeforeEach {
$j = Start-Job -ScriptBlock { 1 + 1 } -Name "My Job"
}
AfterEach {
Get-Job | Remove-Job -Force
}
It "Start-Job produces a job object" {
$j | Should -BeOfType "Sy... | 0 |
LibraryProperties.ps1 | ##############################################################################\n##\n## From Windows PowerShell Cookbook (O'Reilly)\n## by Lee Holmes (http://www.leeholmes.com/guide)\n##\n##############################################################################\n\nfilter Get-PropertyValue($property)\n{\n $_.$pro... | 0 |
sample_52_55.ps1 | <##############################################################
# #
# Copyright (C) Microsoft Corporation. All rights reserved. #
# #
##############################################################>... | 0 |
Spin-Busy.ps1 | function Spin-Busy {
param(
[Int] $msWait = 0,
[String] $spinStr = '-\\|/. ',
[Char[]] $spinChars = [Char[]] ($spinStr.ToCharArray()),
[System.Management.Automation.Host.PSHostRawUserInterface] $rawUI = (Get-Host).UI.RawUI,
[ConsoleColor] $bgColor = $... | 0 |
SSL Oblivious Web Client_1.ps1 | function New-TrustAllWebClient {
# Create a compilation environment
$Provider=New-Object Microsoft.CSharp.CSharpCodeProvider
$Compiler=$Provider.CreateCompiler()
$Params=New-Object System.CodeDom.Compiler.CompilerParameters
$Params.GenerateExecutable=$False
$Params.GenerateInMemory=$True
$Params.IncludeDe... | 0 |
sample_50_57.ps1 | #
# Module manifest for module 'OCI.PSModules.Generativeaiinference'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Generativeaiinference.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
#... | 0 |
1002.ps1 |
$myEndpoint = "<your-endpoint-URL>"
$myResourceGroup="<resource-group-name>"
New-AzResourceGroup -Name $myResourceGroup -Location westus2
New-AzEventGridSubscription `
-Endpoint $myEndpoint `
-EventSubscriptionName demoSubscriptionToResourceGroup `
-ResourceGroupName $myResourceGroup
| 0 |
1344.ps1 |
function Set-CEnvironmentVariable
{
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[Parameter(Mandatory=$true)]
[string]$Name,
[Parameter(Mandatory=$true)]
[string]$Value,
[Parameter(ParameterSetName='ForCurrentUser')]
... | 0 |
4287.ps1 |
function createdropper($killdate, $enckey, $domainfrontheader, $ipv4address, $serverport, $username, $password, $proxyurl, [switch]$Daisy, [switch]$Proxy, [switch]$Insecure, $useragent, $referer) {
$newImplant = $urlstring -split ","
$newImplantURL = $newImplant[0] -replace '"',''
if ($Daisy.IsPresent) {
$conne... | 0 |
sample_59_96.ps1 | #
# Module manifest for module 'OCI.PSModules.Waa'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Waa.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
1460.ps1 |
function Copy-CDscResource
{
[CmdletBinding()]
[OutputType([IO.FileInfo])]
param(
[Parameter(Mandatory=$true)]
[string]
$Path,
[Parameter(Mandatory=$true)]
[string]
$Destination,
[Switch]
$Recurse,
[S... | 0 |
sample_25_36.ps1 | # region Generated
# ----------------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obt... | 0 |
1325.ps1 |
function Get-CIisWebsite
{
[CmdletBinding()]
[OutputType([Microsoft.Web.Administration.Site])]
param(
[string]
[Alias('SiteName')]
$Name
)
Set-StrictMode -Version 'Latest'
Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState
... | 0 |
sample_5_95.ps1 | #
# Module manifest for module 'OCI.PSModules.Dts'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dts.dll'
# Version number of this module.
ModuleVersion = '93.0.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
sample_2_84.ps1 | ###########################################################################
# DC_Hardware
# Version 1.0
# Date: 09-26-2012
# Author: mifannin
# Description: Collects Installed Hardware Data
###########################################################################
Import-LocalizedData -BindingVariable Hardwar... | 0 |
2601.ps1 |
$SqlQuery = "
SELECT server_name + '.' + domain AS Server_Name
, IP_Address
FROM t_server s
INNER JOIN t_server_properties sp ON s.server_id = sp.server_id
INNER JOIN t_server_type_assoc sta ON s.server_id = sta.server_id
INNER JOIN t_server_type st ON sta.type_id = st.type_id
WHERE st.type_name LIKE '%SQL%'
OR... | 0 |
sample_47_32.ps1 | # Use the PowerShell extension setting `powershell.scriptAnalysis.settingsPath` to get the current workspace
# to use this PSScriptAnalyzerSettings.psd1 file to configure code analysis in Visual Studio Code.
# This setting is configured in the workspace's `.vscode/settings.json`.
#
# For more information on PSScrip... | 0 |
Script Listing.ps1 | $pathToScripts = "C:\\Scripts\\*"
foreach($itm in get-childitem $pathToScripts -include *.ps1 -recurse)
{"{0,-25}{1,0}" -f ((" " + $itm.name) -replace ".ps1",""), ((get-content $itm | where {$_ -like "*Purpose:*"}) -replace "# Purpose: ","")}
| 0 |
Async Sockets.ps1 | if (-not ("CallbackEventBridge" -as [type])) {
Add-Type @"
using System;
public sealed class CallbackEventBridge
{
public event AsyncCallback CallbackComplete = delegate { };
private CallbackEventBridge() {}
private void CallbackInternal(IAsyncResult... | 0 |
sample_0_0.ps1 | [dynamic, provider("dcismprovider"), Association]
class DCIM_IPMIServiceServiceDependency : DCIM_RBAServiceServiceDependency
{
[
Description ("Dependent represents the object that is dependent on the Antecedent."),
Override ("Dependent"),
Required
]
CIM_Service REF Depend... | 0 |
Exporting SQLData to CSV.ps1 | #Connection Strings
$Database = "Database"
$Server = "SQLServer"
#SMTP Relay Server
$SMTPServer = "smtp.domain.com"
#Export File
$AttachmentPath = "C:\\SQLData.csv"
# Connect to SQL and query data, extract data to SQL Adapter
$SqlQuery = "SELECT * FROM dbo.Test_Table"
$SqlConnection = New-Object System.Data.Sq... | 0 |
Xml Module 5.0.ps1 | #requires -version 2.0
# Improves over the built-in Select-XML by leveraging Remove-XmlNamespace http`://poshcode.org/1492
# to provide a -RemoveNamespace parameter -- if it's supplied, all of the namespace declarations
# and prefixes are removed from all XML nodes (by an XSL transform) before searching.
# IMP... | 0 |
Out-DataTable.ps1 | #######################
<#
.SYNOPSIS
Creates a DataTable for an object
.DESCRIPTION
Creates a DataTable based on an objects properties.
.INPUTS
Object
Any object can be piped to Out-DataTable
.OUTPUTS
System.Data.DataTable
.EXAMPLE
$dt = Get-Alias | Out-DataTable
This example creates a DataTable fro... | 0 |
Set-WinSchedule_2.ps1 | # Set-WinSchedule
# Written by Tome Tanasovski
# http://powertoe.wordpress.com
# version 1.0
# Created March 2010
#
# Please read through the synopsis->Description to see the list of features that I hope to get
# in a final release. If you choose to work on any of the issues by all means, but please contact
#... | 0 |
sample_9_91.ps1 | #************************************************
# TS_DellPowerEdgeBiosCheck.ps1
# Version 1.0.1
# Date: 5/9/2012
# Author: v-alyao
# Description: [Idea ID 2842] [Windows] Alert Engineers if they are working on a Dell machine models R910, R810 and M910
# Rule number: 2842
# Rule URL: //sharepoint/sites/rules... | 0 |
sample_8_52.ps1 | ###########################################################################
# DC_Get-Network
# Version 1.0
# Date: 09-26-2012
# Author: mifannin
# Description: Creates Autotuning.txt, Firewall.txt, Netsh.txt, Winsock.txt,
# Bitsadmin.txt, WPAD & PAC File Collection
##############################################... | 0 |
3136.ps1 |
[CmdletBinding(DefaultParameterSetName='Decrypt')]
param(
[Parameter(
Position=0,
Mandatory=$true,
HelpMessage='String which you want to encrypt or decrypt')]
[String]$Text,
[Parameter(
Position=1,
HelpMessage='Specify which rotation you want to use (De... | 0 |
sample_44_67.ps1 | #
# Module manifest for module 'OCI.PSModules.Apmtraces'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Apmtraces.dll'
# Version number of this module.
ModuleVersion = '75.1.0'
# Supported PSEditions
Co... | 0 |
Copy-GroupMembership.ps1 | <#
.SYNOPSIS
Copy group membership between two accounts.
.DESCRIPTION
This script will copy the group membership from an existing user
account to a new user account.
.PARAMETER ADSPath
This is the LDAP URL to where your user accounts are stored
.PARAMETER NewUser
... | 0 |
sample_28_3.ps1 | # ------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License (MIT). See License.txt in the repo root for license information.
# ------------------------------------------------------------
function Get-ServiceFabricApp... | 0 |
sample_46_73.ps1 | Import-LocalizedData -BindingVariable lnTxt -FileName AzStackHci.Network.Strings.psd1
function Test-MgmtIpRange
{
[CmdletBinding()]
param (
[Parameter(Mandatory = $false, HelpMessage = "Specify starting Management IP Range")]
[System.Net.IPAddress]
$StartingAddress,
[... | 0 |
3707.ps1 |
function Set-AzAdvisorConfigurationWithLowCpu
{
$propertiesCount = 4
$lowCpuThresholdParameter = 20
$cmdletReturnType = "Microsoft.Azure.Commands.Advisor.Cmdlets.Models.PsAzureAdvisorConfigurationData"
$TypeValue = "Microsoft.Advisor/Configurations"
$queryResult = Set-AzAdvisorConfiguration -LowCpu... | 0 |
2360.ps1 |
[CmdletBinding()]
param
(
[Parameter(Mandatory)]
[ValidateNotNullOrEmpty()]
[string]$ComputerName
)
try
{
$script:SessionEvents = @(
@{ 'Label' = 'Logon'; 'EventType' = 'SessionStart'; 'LogName' = 'Security'; 'ID' = 4624 }
@{ 'Label' = 'Logoff'; 'EventType' = 'SessionStop'; 'LogName' = 'Security'; 'ID... | 0 |
2621.ps1 |
param([string]$DName
,[System.Management.Automation.PSCredential]$DCred
)
configuration LabDC{
param(
[string[]] $ComputerName = 'localhost'
,[string] $NIC = 'Ethernet 2'
,[string] $DomainName
,[System.Management.Automation.PSCredential] $DomainCred
)
Import-Ds... | 0 |
sample_1_6.ps1 | /* ---------------------------------------------------------------------------
* DCIM_SMCLPADHardwareMemberOfCollection
* ---------------------------------------------------------------------------
*/
[dynamic, provider("dcismprovider")]
class DCIM_SMCLPADHardwareMemberOfCollection : CIM_MemberOfCollection
... | 0 |
sample_23_82.ps1 | #!powershell
# Copyright (c) 2022 Ansible Project
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
#AnsibleRequires -CSharpUtil Ansible.Basic
$spec = @{
options = @{
dns_domain_name = @{
type = 'str'
}
domain_admin_user = @{
... | 0 |
3051.ps1 | function Should-HaveParameter (
$ActualValue,
[String] $ParameterName,
$Type,
[String]$DefaultValue,
[Switch]$Mandatory,
[Switch]$HasArgumentCompleter,
[Switch]$Negate,
[String]$Because ) {
if ($null -eq $ActualValue -or $ActualValue -isnot [Management.Automation.CommandInfo]) ... | 0 |
sudo for Powershell_4.ps1 | ## sudo.ps1
#
# Authors: rbellamy, pezhore, mrigns, This guy: http://tsukasa.jidder.de/blog/2008/03/15/scripting-sudo-with-powershell,
# other powershell peoples
#
# Sources:
# http://tsukasa.jidder.de/blog/2008/03/15/scripting-sudo-with-powershell
# http://www.ainotenshi.org/%E2%80%98sud... | 0 |
sample_1_23.ps1 | # TS_AnonymousAuthentication_Enabled.ps1
# Description: Determine whether anonymous authentication is enabled on the CRM web site.
# Created: 1/10/2012
# Author: Jonathan Randall
#*************************************************************************************************
# Date: 11-12-2012
# Description:... | 0 |
sample_50_67.ps1 | <###################################################
# #
# Copyright (c) Microsoft. All rights reserved. #
# #
##################################################>
<#
.Synopsis
Gets a free drive letter fo... | 0 |
sample_36_99.ps1 | #
# Module manifest for module 'OCI.PSModules.Accessgovernancecp'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Accessgovernancecp.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
# Suppo... | 0 |
sample_10_7.ps1 | #!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
$pathsep=":"
$env_node_path=$env:NODE_PATH
$new_node_path="C:\Users\abder\component-maker\web\node_modules\.pnpm\which@2.0.2\node_modules\which\bin\node_modules;C:\Users\abder\component-maker\web\node_modules\.pnpm\which@2.0.2\n... | 0 |
New-XSD.ps1 | # ---------------------------------------------------------------------------
### <Script>
### <Author>
### Chad Miller
### </Author>
### <Description>
### Generates an XSD File with SQLXML annotations for a Powershell object
### The XSD file can be used with SQLXML to automatically create a SQL table
### and ... | 0 |
2154.ps1 |
Describe "Verify PowerShell Runs" {
BeforeAll{
$options = (Get-PSOptions)
$path = split-path -path $options.Output
Write-Verbose "Path: '$path'" -Verbose
$rootPath = split-Path -path $path
$mount = 'C:\powershell'
$container = 'mcr.microsoft.com/powershell:nanoserv... | 0 |
sample_14_99.ps1 | ConvertFrom-StringData @'
EnvironmentErrorAlreadyExists=この名前と種類の環境変数は既に存在します。
EnvironmentErrorDoesNotExists=この名前と種類の環境変数は存在しません。
'@
# SIG # Begin signature block
# MIIoOwYJKoZIhvcNAQcCoIIoLDCCKCgCAQExDzANBglghkgBZQMEAgEFADB5Bgor
# BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG
# KX7zUQIBAAIBA... | 0 |
507.ps1 |
function Write-PPErrorEventLog{
param(
[Parameter(Mandatory=$false)]
[string]$Message,
[Parameter(Mandatory=$false)]
[string]$Source,
[switch]
$ClearErrorVariable
)
if($Error){
$Error | %{$ErrorLog += "$($_.ToString()) $($_.InvocationInfo.Position... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.