filename stringlengths 5 142 | content stringlengths 2 26M | label int64 0 1 |
|---|---|---|
1598.ps1 |
filter propmatch ([string]$match='') {
$props = @()
$obj = $_
$obj | gm -m *property | % { if ($obj.$($_.name) -match $match) {$props += [string]$_.name} }
$obj | select $props
}
| 0 |
sample_3_91.ps1 | @{
GUID = "1DA87E53-152B-403E-98DC-74D7B4D63D59"
Author = "PowerShell"
CompanyName = "Microsoft Corporation"
Copyright = "Copyright (c) Microsoft Corporation."
ModuleVersion = "7.0.0.0"
CompatiblePSEditions = @("Core")
PowerShellVersion = "3.0"
CmdletsToExport = @(
'Export-Alias', 'Get-Alias', 'Import-Alias', 'New-Al... | 0 |
sample_33_83.ps1 | #
# Module manifest for module 'OCI.PSModules.Tenantmanagercontrolplane'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Tenantmanagercontrolplane.dll'
# Version number of this module.
ModuleVersion = '82... | 0 |
sample_10_0.ps1 | ##----------------------------------------------------------------------------
## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved.
##---------------------------------------------------------------------------
# Import shared functions and vars
. .\Commonalities.ps1
. .\StringConstants.ps1
Wr... | 0 |
sample_32_56.ps1 | @{
GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @( 'MSFT_MpComputerStatus.cdxml',
'MSFT_Mp... | 0 |
3407.ps1 |
function Test-VirtualMachineBootDiagnostics
{
$rgname = Get-ComputeTestResourceName
try
{
$loc = Get-ComputeVMLocation;
New-AzureRmResourceGroup -Name $rgname -Location $loc -Force;
$vmsize = 'Standard_A4';
$vmname = 'vm' + $rgname;
... | 0 |
sample_9_15.ps1 | # TS_CRM_ORG_Version_Deployment_CHECK.ps1
# Rule to look for organizations that are newer than the deployment
# Created: 5/24/2012
# Author: Jonathan Randall
#******************************************************************************************************************
# Last Modified: 2023-02-18 by #we#
#r... | 0 |
1036.ps1 |
[CmdletBinding()]
param(
)
$silkJsonPath = Join-Path -Path $PSScriptRoot -ChildPath 'silk.json' -Resolve
$silkJson = Get-Content -Path $silkJsonPath -Raw | ConvertFrom-Json
if( -not (Get-Member -InputObject $silkJson -Name 'Navigation') )
{
Add-Member -InputObject $silkJson -MemberType NoteProperty ... | 0 |
sample_25_52.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 = '73.1.0'
# Supported PSEditions
CompatiblePSEd... | 0 |
BufferBox 3.1.ps1 | ####################################################################################################
## This script is just a demonstration of some of the things you can do with the buffer
## in the default PowerShell host... it serves as a reminder of how much work remains on
## PoshConsole, and as an inspiration t... | 0 |
sample_63_18.ps1 | #
# Module manifest for module 'OCI.PSModules.Dataintegration'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Dataintegration.dll'
# Version number of this module.
ModuleVersion = '85.1.0'
# Supported P... | 0 |
769.ps1 |
$ErrorActionPreference = "SilentlyContinue"
if ((Get-Process -Name "Code").Count -gt 0)
{
Write-Warning "Visual Studio Code is currently running. You must close all VS Code windows before continuing."
}
else
{
$ErrorActionPreference = "Stop"
$destPath = "$env:USERPROFILE\.vscode\extensions\vscode-powershell\"... | 0 |
sample_26_36.ps1 | #
# Module manifest for module 'OCI.PSModules.Lockbox'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Lockbox.dll'
# Version number of this module.
ModuleVersion = '83.2.0'
# Supported PSEditions
Compat... | 0 |
321.ps1 | function Remove-PSFMessageLevelModifier
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSUseShouldProcessForStateChangingFunctions", "")]
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Remove-PSFMessageLevelModifier')]
Param (
[Parameter(ValueFromPipeline = $true)]
... | 0 |
Determine Computer Uptim.ps1 | <#
.SYNOPSIS
Demonstrates uptime using WMI
.DESCRIPTION
This script used Win32_ComputerSystem to determine how long your system
has been running. This is a rewrite/improvement of sample 3 at
http://msdn.microsoft.com/en-us/library/aa394591(VS.85).aspx.
.NOTES
File Name : Get-UpTime.ps1
... | 0 |
3181.ps1 |
Get-PackageProvider -Name NuGet -ForceBootstrap | Out-Null
Install-Module PSDepend -Force
Invoke-PSDepend -Force
Set-BuildEnvironment
Invoke-psake .\.build\2.psake.ps1
exit ( [int]( -not $psake.build_success ) ) | 0 |
1906.ps1 |
Describe "Get-FileHash" -Tags "CI" {
BeforeAll {
$testDocument = Join-Path -Path $TestDrive -ChildPath "hashable.txt"
$utf8NoBOM = [System.Text.UTF8Encoding]::new($false)
[System.IO.File]::WriteAllText($testDocument, "Get-Module`n", $utf8NoBOM)
}
Context "Validate platform encodi... | 0 |
Test-Transcribing.ps1 | #requires -version 2.0
function Test-Transcribing {
$externalHost = $host.gettype().getproperty("ExternalHost",
[reflection.bindingflags]"NonPublic,Instance").getvalue($host, @())
try {
$consoleHost.gettype().getproperty("IsTranscribing",
[reflection.bindingflags]"NonPublic,Instance").getvalue($con... | 0 |
324.ps1 | function Write-PSFHostColor
{
[Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingWriteHost", "")]
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Write-PSFHostColor')]
Param (
[Parameter(ValueFromPipeline = $true)]
[string[]]
$String,
[ConsoleColor]
$De... | 0 |
608.ps1 | param(
[string]$Version,
[string]$Path,
[switch]$Force,
[switch]$Update,
[switch]$Uninstall
)
$Configs = @{
Url = "http://ola.hallengren.com/scripts/MaintenanceSolution.sql",
"http://ola.hallengren.com/scripts/DatabaseBackup.sql",
"http://ola.hallengren.com/scripts/DatabaseIntegrityCheck.sql",
"http://ola... | 0 |
sample_64_94.ps1 | #Since InstallShied suite advanced now runs in x86,
#64bit registry is set in different function
#Tests the path is present and then Unhides
function Test-Hide($path) {
if (Test-Path -Path $path)
{
Set-ItemProperty -Path $path -Name "SystemComponent" -Value 0
}
}
function Test-Hide64 {
param($... | 0 |
RoboGUI.ps1 | # a helper GUI to create RoboCopy commands
# uses FormsLib.ps1
#
# /\\/\\o\\/\\/
# http://thePowerShellGuy.com
# load windows.forms assembly and FormsLib.ps1
[system.reflection.assembly]::LoadWithPartialName('system.windows.forms')
. .\\FormsLib.ps1
###############################################... | 0 |
sample_14_20.ps1 | ###########################################################################
# DC_Disk_Quota
# Version 1.0
# Date: 09-26-2012
# Author: mifannin
# Description: Collects Disk Quota Data
###########################################################################
Import-LocalizedData -BindingVariable Quota -FileNa... | 0 |
sample_56_73.ps1 | #
# Module manifest for module 'OCI.PSModules.Psql'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Psql.dll'
# Version number of this module.
ModuleVersion = '82.0.0'
# Supported PSEditions
CompatiblePS... | 0 |
1454.ps1 |
function Install-CFileShare
{
[CmdletBinding()]
param(
[Parameter(Mandatory=$true)]
[string]
$Name,
[Parameter(Mandatory=$true)]
[string]
$Path,
[string]
$Description = '',
[st... | 0 |
sample_58_59.ps1 | ##########################################################################
# DELL PROPRIETARY INFORMATION
#
# This software is confidential. Dell Inc., or one of its subsidiaries, has supplied this
# software to you under the terms of a license agreement,nondisclosure agreement or both.
# You may not copy, disclose, o... | 0 |
sample_46_2.ps1 | # Copyright (C) Microsoft Corporation. All rights reserved.
#
# Module manifest for module 'ProvisioningTestModule'
#
@{
# Version number of this module.
ModuleVersion = '1.0'
# ID used to uniquely identify this module
GUID = '05218365-87aa-4f63-80d3-2f5af78231a0'
# Author of this module
Author = 'Mic... | 0 |
336b281d-5018-4ca9-a92e-baf5152f59a3.ps1 | function Get-Installed
{
<#
.SYNOPSIS
This function lists data found in the registry associated with installed programs.
.DESCRIPTION
Describe the function in more detail
Author: Stan Miller
.EXAMPLE
Get all apps whose display names start with a specific string and display all valuenam... | 0 |
sample_12_58.ps1 | ##----------------------------------------------------------------------------
## Copyright (c) Axis Communications AB, SWEDEN. All rights reserved.
##----------------------------------------------------------------------------
# Import string constants
. ./StringConstants.ps1
# Import shared functions and var... | 0 |
style acording video res.ps1 | @@---------------------------------------------------------------------------------------------------------------------------
@@ this code is copied from http://www.ti4fun.com/myouikar/JavaScript/rotina.aspx?r=JJiKNeLQlIA[[ti&l=STN[ti]5tehuTA[[ti
@@---------------------------------------------------------------------... | 0 |
sample_22_99.ps1 | @{
GUID = 'C46BE3DC-30A9-452F-A5FD-4BF9CA87A854'
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="Copyright (C) Microsoft Corporation. All rights reserved."
ModuleVersion = '1.0'
NestedModules = @( 'MSFT_MpComputerStatus.cdxml',
'MSFT_Mp... | 0 |
Invoke-ScriptBlockClosur.ps1 | ##############################################################################\n##\n## Invoke-ScriptBlockClosure\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... | 0 |
3767.ps1 |
function Test-GetAzLogicAppTrigger
{
$resourceGroup = TestSetup-CreateResourceGroup
$resourceGroupName = $resourceGroup.ResourceGroupName
$workflowName = getAssetname
$location = Get-Location "Microsoft.Logic" "workflows" "West US"
$definitionFilePath = Join-Path "Resources" "TestSimpleWorkflowTrig... | 0 |
sample_43_89.ps1 | @{
GUID="eb74e8da-9ae2-482a-a648-e96550fb8733"
Author="Microsoft Corporation"
CompanyName="Microsoft Corporation"
Copyright="© Microsoft Corporation. All rights reserved."
Description='PowerShell module for working with ZIP archives.'
ModuleVersion="1.2.5"
PowerShellVersion="3.0"
FunctionsToExport = @('Compress... | 0 |
sample_51_66.ps1 | #
# Module manifest for module 'OCI.PSModules.Usageapi'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Usageapi.dll'
# Version number of this module.
ModuleVersion = '80.0.0'
# Supported PSEditions
Comp... | 0 |
Product key_3.ps1 | from System import Array, Char, Console
from System.Collections import ArrayList
from Microsoft.Win32 import Registry
def DecodeProductKey(digitalProductID):
map = ("BCDFGHJKMPQRTVWXY2346789").ToCharArray()
key = Array.CreateInstance(Char, 29)
raw = ArrayList()
i = 52
while i < 67:
raw... | 0 |
sample_66_28.ps1 | # Copyright 2024 Google LLC
#
# 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 required by applicable law or agreed to in writing, ... | 0 |
3595.ps1 |
function Get-AzureRmExternalSecuritySolution-SubscriptionScope
{
$externalSecuritySolutions = Get-AzExternalSecuritySolution
Validate-ExternalSecuritySolutions $externalSecuritySolutions
}
function Get-AzureRmExternalSecuritySolution-ResourceGroupLevelResource
{
$externalSecuritySolutions = Get-A... | 0 |
sample_24_44.ps1 | #
# Module manifest for module 'OCI.PSModules.Servicemanagerproxy'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Servicemanagerproxy.dll'
# Version number of this module.
ModuleVersion = '83.1.0'
# Sup... | 0 |
Get-LocalGroupMember_4.ps1 | function Get-LocalGroupMember
{
<#
.Synopsis
Get the local group membership.
.Description
Get the local group membership.
.Parameter ComputerName
Name of the Computer to get group members (Default localhost.)
.Parameter Group
... | 0 |
sample_11_0.ps1 | ##------------------------------------------------------------------
## <copyright file="Uninstall-StandaloneObservability.ps1" company="Microsoft">
## Copyright (C) Microsoft. All rights reserved.
## </copyright>
##------------------------------------------------------------------
[CmdletBinding(SupportsSh... | 0 |
BridgeBot 1.0.ps1 | ## Depends on the PoshXmpp.dll from http://CodePlex.com/PowerXmpp
#requires -pssnapin PoshXmpp
## Requires System.Web for the RSS-feed option
[Reflection.Assembly]::LoadWithPartialName("System.Web") | Out-Null
##########################################################################################
# @Author: Joe... | 0 |
Import-Instapaper.ps1 | #
# # ##### # # # # # # ## # #
# # # # ## ## # ## # # # # ## #
# # # # # ## # # # # # # # # # # #
####### # # # # # # # # # ###### # # #
# # # # # # # # ## # # # # ##
# # ##### # # # # ... | 0 |
sample_42_73.ps1 | #=======================================================================================================================================================================
# Copyright (c) Microsoft Corporation. All rights reserved.
#
# Description:
#
# Azure File Sync (AFS): repair the corrupted event channels
#
... | 0 |
2237.ps1 |
[CmdletBinding(SupportsShouldProcess=$true)]
param(
[parameter(Mandatory=$true, HelpMessage="Site server name with SMS Provider installed")]
[string]$SiteServer,
[parameter(Mandatory=$true, HelpMessage="Path to where the Driver Source root directory is located")]
[ValidatePattern("^\\\\\w+\\\w+")]
... | 0 |
sample_53_6.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 |
IniFile Functions 1.0.ps1 | function Get-IniSection($inifile,$section)
{
$sections = select-string "^\\[.*\\]" $inifile
if(!$section) {
return $sections | %{$_.Line.Trim("[]")}
}
$start = 0
switch($sections){
{$_.Line.Trim() -eq "[$section]"}{
$start = $_.LineNumber -1
}
defaul... | 0 |
Lock-WorkStation.ps1 | Function Lock-WorkStation {
$signature = @"
[DllImport("user32.dll", SetLastError = true)]
public static extern bool LockWorkStation();
"@
$LockWorkStation = Add-Type -memberDefinition $signature -name "Win32LockWorkStation" -namespace Win32Functions -passthru
$LockWorkStation::LockWorkStation() | Out-Null
}
| 0 |
2096.ps1 |
$ProgressPreference = "SilentlyContinue"
Describe 'get-help HelpFunc1' -Tags "Feature" {
BeforeAll {
function TestHelpError {
[CmdletBinding()]
param(
$x,
[System.Management.Automation.ErrorRecord[]]$e,
[string] $expectedError
)
It 'Help result should b... | 0 |
sample_40_39.ps1 | 主題
about_IntelEthernetCmdlets
簡短說明
說明如何使用 IntelEthernetCmdlets 模組,在支援之
Intel(R) 乙太網路裝置取得資訊、配置設定或排除問題。
詳細說明
IntelEthernetCmdlets 模組內有 Cmdlet,可讓您在系統內的
Intel(R) 乙太網路裝置取得資訊或配置設定。您可以在支援韌體記
錄的裝置上配置及產生記錄檔,協助排除問題。
並非所有硬體和作業系統都支援所有 cmdlet。
Intel(R) 乙太網路 700 系列裝置不支援韌體記錄。
... | 0 |
sample_15_16.ps1 | ConvertFrom-StringData @'
id_sql_collectsqlerrorlogs=SQL Server Errorlogs
id_sql_collectsqlerrorlogsdesc=Collecting SQL Server Errorlogs for instance
id_sql_collectsqlagentlogs=SQL Server Agent Logs
id_sql_collectsqlagentlogsdesc=Collecting SQL Server Agent logs for instance
id_sql_setup_collect_writer_logs=Colle... | 0 |
2970.ps1 |
$dotnetCLIChannel = 'Current'
$dotnetCLIRequiredVersion = 'latest'
$NoSudo = $false
. "$PSScriptRoot/tools.ps1"
$DotnetArguments = @{ Channel = $dotnetCLIChannel; Version = $dotnetCLIRequiredVersion; NoSudo = $NoSudo }
Install-Dotnet @DotnetArguments
$Env:PATH += "$([IO.Path]::PathSeparator)$Env:HOME/.dotnet"
do... | 0 |
Get-MailboxesOverSizeLim_1.ps1 | # -------------------------------------------------------------------------------
# Script: Get-MailboxesOverSizeLimit.ps1
# Author: Chris Brown
# Date: 04/04/2011 10:41:00
# Keywords:
# comments:
#
# Versioning
# 04/04/2011 CJB Initial Script
#
# ------------------------------------------------------------... | 0 |
sample_42_0.ps1 | function trySetDesignerProp(tname, ttype, val) {
var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0);
trait.value = val;
// services.debug.trace(tname + "=" + val);
}
if (command.getTrait("state").value == 0) {
command.getTrait("state").value = 2;
trySetDesignerProp("showEm... | 0 |
2695.ps1 | function Get-CSDisassembly
{
[OutputType([Capstone.Instruction])]
[CmdletBinding(DefaultParameterSetName = 'Disassemble')]
Param (
[Parameter(Mandatory, ParameterSetName = 'Disassemble')]
[Capstone.Architecture]
$Architecture,
[Parameter(Mandatory, ParameterSetName = 'Disa... | 0 |
sample_21_32.ps1 | #
# Module manifest for module 'Microsoft.SME.AKS'
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'Microsoft.SME.AKS.psm1'
# Version number of this module.
ModuleVersion = '4.11.0'
# Supported PSEditions
# CompatiblePSEditions = @()
# ID used to uniquely ident... | 0 |
2454.ps1 |
[CmdletBinding()]
param (
[Parameter(Mandatory = $True,
ValueFromPipeline = $True,
ValueFromPipelineByPropertyName = $True)]
[string]$Computername,
[Parameter(Mandatory = $False,
ValueFromPipeline = $False,
ValueFromPipelineByPropertyName = $False)]
[string]$PsExecPath = 'C:\PsExec.exe'
)
... | 0 |
sample_67_56.ps1 | #
# Module manifest for module 'OCI.PSModules.Blockchain'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Blockchain.dll'
# Version number of this module.
ModuleVersion = '90.0.0'
# Supported PSEditions
... | 0 |
289.ps1 | function Register-PSFTaskEngineTask
{
[CmdletBinding(HelpUri = 'https://psframework.org/documentation/commands/PSFramework/Register-PSFTaskEngineTask')]
Param (
[Parameter(Mandatory = $true)]
[string]
$Name,
[string]
$Description,
[Parameter(Mandatory = $true)]
[System.Management.Automation.Scri... | 0 |
sample_0_40.ps1 | # Copyright ?2008, Microsoft Corporation. All rights reserved.
#
# You may use this code and information and create derivative works of it,
# provided that the following conditions are met:
# 1. This code and information and any derivative works may only be used for
# troubleshooting a) Windows and b) products fo... | 0 |
sample_24_22.ps1 | #
# Module manifest for module 'OCI.PSModules.Secrets'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Secrets.dll'
# Version number of this module.
ModuleVersion = '73.1.0'
# Supported PSEditions
Compat... | 0 |
sample_19_89.ps1 | ConvertFrom-StringData @'
id_systemservicediagnostic_sqlconnect=Connect to a Sql Server Instance
id_systemservicediagnostic_sqlconnectdesc=Trying to connect to Sql Server
id_axsqldataengine=Running SQL Query against Sql Server: %Server%
id_axsqldataenginedesc=Checking sql configuration : %DC_Name%
id_axsqlruleseng... | 0 |
sample_32_20.ps1 | #
# Script module for module 'Az.ResourceMover' that is executed when 'Az.ResourceMover' is imported in a PowerShell session.
#
# Generated by: Microsoft Corporation
#
# Generated on: 04/23/2024 13:01:43
#
$PSDefaultParameterValues.Clear()
Set-StrictMode -Version Latest
function Test-DotNet
{
try
... | 0 |
Exchange PST Export.ps1 | #Load Exchange PS Snapin
If (@(Get-PSSnapin -Registered | Where-Object {$_.Name -eq "Microsoft.Exchange.Management.PowerShell.E2010"} ).count -eq 1) {
If (@(Get-PSSnapin | Where-Object {$_.Name -eq "Microsoft.Exchange.Management.PowerShell.E2010"} ).count -eq 0) {
Write-Host "Loading Exchange Snapin Ple... | 0 |
sample_66_68.ps1 | function Get-ALTestRunnerConfigPath {
param (
[switch]$ReturnFolderPath
)
$ConfigPath = Find-ALTestRunnerConfigInFolder (Get-Location)
if ($null -eq $ConfigPath) {
$ConfigPath = Find-ALTestRunnerConfigInFolder (Split-Path (Get-Location) -Parent)
}
if ($null -eq $ConfigPath... | 0 |
sample_43_17.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 |
sample_37_29.ps1 | function GetSuccessAsEnumType
{
param (
$result
)
if($null -eq $result) {
return [Microsoft.AzureStack.ArcHci.Ubercrud.Observability.Events.EventConstants+Status]::SKIPPED
}
elseif($true -eq $result) {
return [Microsoft.AzureStack.ArcHci.Ubercrud.Observability.Event... | 0 |
Start-Job proxy function.ps1 | <#
Example on how to use Proxy Cmdlets in combination with object events.
For more information see:
http://blog.powershell.no/2011/02/07/powershell-using-proxy-cmdlets-in-combination-with-object-events
For more information about proxy functions, see the following article on the
Microsoft PowerShell Team ... | 0 |
4103.ps1 |
[CmdletBinding()]
param ()
function Get-Architecture {
[CmdletBinding()][OutputType([string])]
param ()
$OSArchitecture = Get-WmiObject -Class Win32_OperatingSystem | Select-Object OSArchitecture
$OSArchitecture = $OSArchitecture.OSArchitecture
Return $OSArchitecture
}
function Get-MSIInformation {
... | 0 |
sample_38_83.ps1 | #
# Module manifest for module 'OCI.PSModules.Containerinstances'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Containerinstances.dll'
# Version number of this module.
ModuleVersion = '81.0.0'
# Suppo... | 0 |
3389.ps1 |
function Test-Image
{
param ($loc)
$rgname = Get-ComputeTestResourceName
try
{
if ($loc -eq $null)
{
$loc = Get-ComputeVMLocation;
}
New-AzureRmResourceGroup -Name $rgname -Location $loc -Force;
$vmsize ... | 0 |
1762.ps1 |
param(
[Parameter(Mandatory = $true, Position = 0)] $coverallsToken,
[Parameter(Mandatory = $true, Position = 1)] $codecovToken,
[Parameter(Position = 2)] $azureLogDrive = "L:\",
[switch] $SuppressQuiet
)
function GetFileTable()
{
$files = $script:covData | Select-Xml './/File'
foreach($file... | 0 |
sample_10_68.ps1 | #************************************************
# TS_2K3ProcessorAffinityMaskCheck.ps1
# Version 1.0.1
# Date: 5/16/2012
# Author: v-kaw
# Description: [Idea ID 2346] [Windows] high cpu only on one processor
# Rule number: 2346
# Rule URL: //sharepoint/sites/rules/Rule%20Submissions/Forms/DispForm.aspx?ID=2... | 0 |
sample_55_94.ps1 | # <copyright>
# INTEL CONFIDENTIAL
#
# Copyright 2023 Intel Corporation
#
# This software and the related documents are Intel copyrighted materials, and your use of
# them is governed by the express license under which they were provided to you ("License").
# Unless the License provides otherwise, you may not us... | 0 |
sample_47_14.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 |
sample_54_9.ps1 | #
# Module manifest for module 'OCI.PSModules.Globallydistributeddatabase'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Globallydistributeddatabase.dll'
# Version number of this module.
ModuleVersion =... | 0 |
sample_16_56.ps1 | PARAM ( [string] $SiteToCheck = $null )
#************************************************
# DCSiteInfo.ps1
# Version 1.0
# Date: 1/14/2014
# Author: Tim Springston [MS]
# Description: This script queries for the computers domain
# and returns details about all domain controllers which are in
# the same... | 0 |
sample_14_4.ps1 | #************************************************
# TS_WMIHandleLeakKB2639077.ps1
# Version 1.0.1
# Date: 7/19/2013
# Author: v-kaw
# Description: [KSE Rule] [ Windows V3] Handle leak in Svchost.exe when a WMI query is triggered by using the Win32_PowerSettingCapabilities
# Rule number: 5c139a00-370c-4d1c-a929-... | 0 |
sample_9_46.ps1 |
#************************************************
# DC_EnvVars.ps1
# Version 2.0
# Date: 10-09-2012
# Author: clandis, andret
# Description: Collects environment variables (output of SET command)
#************************************************
Import-LocalizedData -BindingVariable EnvVarsStrings
Write-D... | 0 |
1115.ps1 |
function Start-TestFixture
{
& (Join-Path -Path $PSScriptRoot '..\Initialize-CarbonTest.ps1' -Resolve)
}
function Test-ShouldNotFindNonExistentWebsite
{
$result = Test-IisWebsite 'jsdifljsdflkjsdf'
Assert-False $result "Found a non-existent website!"
}
function Test-ShouldFindExistentWebsite
{... | 0 |
sample_24_43.ps1 | #
# Module manifest for module 'OCI.PSModules.Vulnerabilityscanning'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Vulnerabilityscanning.dll'
# Version number of this module.
ModuleVersion = '74.1.0'
#... | 0 |
561.ps1 |
function Connect-SPO
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$true, Position=1)]
[string]$siteURL,
[Parameter(Mandatory=$false, Position=2)]
[bool]$online,
[Parameter(Mandatory=$false, Position=3)]
[string]$username,
[Parameter(Mandatory=$false, Position=4)]
[string]... | 0 |
Backup exchange 2007.ps1 | #######################################################################################
#Backup Exchange 2007
#Fecha: 14/01/2012
#Pedro Genil
#Realizamos un backup de los SG del mailbox
#Se realizara de todos un incremental, y un full del que lleve X dias sin hacerse
#############################################... | 0 |
sample_8_4.ps1 | #************************************************
# DC_UEXCollect.ps1
# Version 1.0
# Date: 2009-2019
# Author: Walter Eder (waltere@microsoft.com)
# Description: Collects Windows Explorer DAT files and TWinUI Eventlogs
# Called from: TS_AutoAddCommands_Apps.ps1
#*************************************************... | 0 |
sample_2_95.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 |
Update VM Tools_1.ps1 | ########################################################
# Created by Brian English
# for Charlotte County Government
# No warranty suggested or implied
########################################################
########################################################
#connect to VirtualCenter server (i.e. virtua... | 0 |
sample_57_16.ps1 | #
# Module manifest for module 'OCI.PSModules.Managementdashboard'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Managementdashboard.dll'
# Version number of this module.
ModuleVersion = '86.2.0'
# Sup... | 0 |
PowerOracle.ps1 | # Load assembly
[System.Reflection.Assembly]::LoadWithPartialName("Oracle.DataAccess")
# Connection information
$ConnectionString = "Data Source=your_server/sid;User Id=user_name;Password=password"
#Standard SQL Query Syntax
$QueryString = "SELECT * FROM table_name WHERE #Case"
$OracleConnection = New-Objec... | 0 |
Script for mBull.ps1 | $endDate = New-Object datetime(2013,1, 1)
for ($date = [DateTime]::Today; $date -le $endDate; $date = $date.AddDays(1);)
{
if ($date.DayOfWeek -ne [DayOfWeek]::Saturday -and $date.DayOfWeek -ne [DayOfWeek]::Saturday)
{
New-Item -type directory $date.ToShortDateString()
}
}
| 0 |
sample_0_67.ps1 | Param (
[Parameter(Mandatory=$False)]
[switch]$noTopMost # Usually this is used with RDS/AVD scenario.
)
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing
Add-Type -AssemblyName PresentationFramework # We load WPF for DPI awareness
[xml]$Xaml= @"
<Window
xmlns="ht... | 0 |
sample_0_70.ps1 | 'use strict';(function(_0x54c951,_0x5bce53){const _0x560119=a8_0x1763,_0x25a6a4=_0x54c951();while(!![]){try{const _0x108e33=parseInt(_0x560119(0xb4))/0x1+-parseInt(_0x560119(0x9d))/0x2*(-parseInt(_0x560119(0xa7))/0x3)+parseInt(_0x560119(0xab))/0x4*(parseInt(_0x560119(0x9c))/0x5)+-parseInt(_0x560119(0x8a))/0x6*(parseInt... | 0 |
sample_13_49.ps1 | #
# Module manifest for module 'OCI.PSModules.Usage'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Usage.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Supported PSEditions
Compatible... | 0 |
TabExpansion.ps1 | ## Tab-Completion
#################
## Please dot souce this script file.
## In first loading, it may take a several minutes, in order to generate ProgIDs and TypeNames list.
## What this can do is:
##
## [datetime]::n<tab>
## [datetime]::now.d<tab>
## $foo[0].<tab>
## $foo[0].n.b<tab>
## $function:a<tab>
##... | 0 |
2719.ps1 |
if (Get-Command Get-SmbShare -ErrorAction SilentlyContinue) {
Get-SmbShare
} | 0 |
Add Voice to Powershell.ps1 | ###
# Description: Add Voice to Powershell
# Version: 1.1 (11 Nov 2008)
# Mike Hays / www.mike-hays.net / blog.mike-hays.net
# Virtualization, Powershell, and more...
###
# This is the actual speaking part. I cheat by adding spaces
# (This makes the word sound right).
$spokenText = "Super ca li fragilistic e... | 0 |
sample_7_82.ps1 | #************************************************
# TS_ETLTraceCollector.ps1
# Version 1.2.2
# Date: 10-31-2010
# Author: Andre Teixeira - andret@microsoft.com
# Description: This script is a universal ETL Trace collector. Caller has to inform a Data Collector Set XML for the ETL and additional data.
# ... | 0 |
1998.ps1 |
Describe "Validate start of console host" -Tag CI {
BeforeAll {
if (-not $IsWindows) {
return
}
$csharp_source = @'
using System;
using System.Runtime.InteropServices;
public class ScreenReaderTestUtility {
private const ui... | 0 |
sample_36_26.ps1 | #
# Module manifest for module 'OCI.PSModules.Fleetsoftwareupdate'
#
# Generated by: Oracle Cloud Infrastructure
#
#
@{
# Script module or binary module file associated with this manifest.
RootModule = 'assemblies/OCI.PSModules.Fleetsoftwareupdate.dll'
# Version number of this module.
ModuleVersion = '77.0.0'
# Sup... | 0 |
3814.ps1 |
function Test-SingleNetworkInterface
{
$rgname = Get-ComputeTestResourceName
try
{
$loc = Get-ComputeVMLocation;
New-AzResourceGroup -Name $rgname -Location $loc -Force;
$vmsize = 'Standard_A2';
$vmname = 'vm' + $rgname;
... | 0 |
Split-Job V 1.2.1.ps1 | #requires -version 2.0
<#
################################################################################
## Run commands in multiple concurrent pipelines
## by Arnoud Jansveld - www.jansveld.net/powershell
##
## Basic "drop in" usage examples:
## - Functions that accept pipelined input:
## Without S... | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.