filename
stringlengths
5
142
content
stringlengths
2
26M
label
int64
0
1
sample_24_80.ps1
# # Module manifest for module 'OCI.PSModules.Sch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Sch.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSEditions CompatiblePSEd...
0
sample_12_41.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_15_65.ps1
<# .SYNOPSIS Scenario module for collecting machine licensing/activation related data .DESCRIPTION Collect machine licensing/activation related troubleshooting data .NOTES Author : Robert Klemencz Requires : MSRD-Collect.ps1 Version : See MSRD-Collect.ps1 version Feedback : htt...
0
sample_56_6.ps1
# # Module manifest for module 'OCI.PSModules.Managementagent' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Managementagent.dll' # Version number of this module. ModuleVersion = '86.2.0' # Supported P...
0
2641.ps1
$dbs = Invoke-Sqlcmd -ServerInstance localhost -Database tempdb -Query "SELECT name FROM sys.databases WHERE database_id != 2 and state_desc = 'ONLINE'" $datestring = (Get-Date -Format 'yyyyMMddHHmm') foreach($db in $dbs.name){ $dir = "C:\Backups\$db" if( -not (Test-Path $dir)){New-Item -ItemType Di...
0
3478.ps1
function Test-KustoDatabaseLifecycle { try { $RGlocation = Get-RG-Location $location = Get-Location $resourceGroupName = Get-RG-Name $clusterName = Get-Cluster-Name $sku = Get-Sku $databaseName = Get-Database-Name $resourceType = Get-Database-Type $softDeletePeriodInDays = Get-Soft-Delete-Period-...
0
385.ps1
function HaveProperty { [CmdletBinding()] param ( $ActualValue, [string] $PropertyName, $WithValue, [switch] $Negate ) end { $shouldTestValue = $PSBoundParameters.ContainsKey('WithValue') if ($null -eq $ActualValue) { if ($shouldTestValue) { if ($Negate.IsPresent) { $f...
0
1946.ps1
Describe 'Tests for Wait-Debugger' -Tags "CI" { BeforeAll { Register-DebuggerHandler } AfterAll { Unregister-DebuggerHandler } Context 'Wait-Debugger should break on the statement containing the Wait-Debugger command' { BeforeAll { $testScript = { ...
0
Find Local Group Members_2.ps1
# Author: Hal Rottenberg # Purpose: Find matching members in a local group # Used tip from RichS here: http://powershellcommunity.org/Forums/tabid/54/view/topic/postid/1528/Default.aspx # Change these two to suit your needs $ChildGroups = "Domain Admins", $LocalGroup = "Administrators" $error.clear() $MemberNa...
0
625.ps1
param( [string]$Version, [string]$Path, [switch]$Force, $Update, [switch]$Uninstall ) $Configs = @{ Url = "http://netcologne.dl.sourceforge.net/project/keepass/KeePass%202.x/2.27/KeePass-2.27-Setup.exe" Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\" } $Configs | ForEach-Object{...
0
sample_2_75.ps1
#************************************************ # DC_HyperVNetworkVirtualization.ps1 # Version 1.0 # Date: May 2014 # Author: Boyd Benson (bbenson@microsoft.com) with assistance from Tim Quinn (tiquinn@microsoft.com) # Description: PS cmdlets # Called from: Networking Diags #**********************************...
0
sample_30_20.ps1
Get-WsusServer Get-WsusServer | Invoke-WsusServerCleanup -CleanupObsoleteUpdates -CleanupUnneededContentFiles cd C:\Users\sampler-win_2022_x64\Desktop\ sqlcmd stop-service WSUSService, W3SVC get-service WSUSService, W3SVC stop-service WSUSService stop-service wsusservice get-service wsusservice stop-service ws...
0
sample_27_81.ps1
# # Module manifest for module 'Microsoft.SME.ClusterCreation' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.ClusterCreation.psm1' # Version number of this module. ModuleVersion = '2.124.1' # Supported PSEditions # CompatiblePSEditions = @() # ...
0
sample_51_31.ps1
# # PowerConsole profile # <# .SYNOPSIS Clear the host content. .DESCRIPTION This function replaces the standard Clear-Host and is aliased by "cls". #> function Clear-Host { $host.PrivateData.ClearHost() } <# .SYNOPSIS Simple path completion function for PowerConsole. #> funct...
0
3458.ps1
function Test-LinkedService { $dfname = Get-DataFactoryName $rgname = Get-ResourceGroupName $rglocation = Get-ProviderLocation ResourceManagement $dflocation = Get-ProviderLocation DataFactoryManagement New-AzResourceGroup -Name $rgname -Location $rglocation -Force try ...
0
sample_8_84.ps1
#************************************************ # DC_ServicingLogs.ps1 # Version 1.0 # Date: 2009-2019 # Author: + Walter Eder (waltere@microsoft.com) # Description: Collects Servicing additional information. # Called from: TS_AutoAddCommands_SETUP.ps1 #******************************************************* ...
0
List Object Discoveries.ps1
# Enumerate OpsMgr 2007 Object Discoveries targeted to Windows Server # Date: 13/10/2008 # Author: Stefan Stranger (help from Jeremy Pavleck and Marco Shaw) get-discovery |? {$_.Target -match (get-monitoringclass | where {$_.Name -eq "Microsoft.Windows.Server.Computer"}).Id} | select Name, DisplayName
0
sample_38_27.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 = '74.1.0' # Supported PSEditions Compatible...
0
sample_37_84.ps1
# # Module manifest for module 'OCI.PSModules.Cims' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Cims.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions CompatiblePS...
0
Get-SiSReport.ps1
Function New-LocalUser { <# .SYNOPSIS Create a new user account on the local computer. .DESCRIPTION This function will create a user account on the local computer. .PARAMETER Computer The NetBIOS name of the computer that you will create the account on. .PARAMETER User The user ...
0
sample_30_30.ps1
# # Module manifest for module 'OCI.PSModules.Redis' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Redis.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions Compatible...
0
sample_57_15.ps1
# Localized 06/28/2023 08:16 AM (GMT) 303:7.0.30723 rs_disableusbselective.psd1 ConvertFrom-StringData @' ###PSLOC reset_USBSelective=Activation de la suspension sélective USB Report_name_USBSelective_AC_result=Résultat de l’activation de la suspension sélective USB pour le courant alternatif Report_name_USBSelec...
0
UIAutomation Simple.ps1
[Reflection.Assembly]::Load("UIAutomationClient, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35") [Reflection.Assembly]::Load("UIAutomationTypes, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35") function Select-Window { PARAM( [string]$Text="*", [switch]$Recurse, [Syst...
0
sample_55_48.ps1
# # Module manifest for module 'OCI.PSModules.Certificatesmanagement' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Certificatesmanagement.dll' # Version number of this module. ModuleVersion = '84.0.0' ...
0
4153.ps1
param ( [switch] $FullScan, [switch] $QuickScan, [switch] $Email, [string] $EmailRecipient = '', [string] $EmailSender = '', [string] $SMTPServer = '' ) Import-Module $env:ProgramFiles"\Microsoft Security Client\MpProvider\MpProvider.psd1" $RelativePath = (split-path $SCRIPT:MyInvocation.MyCommand.Path ...
0
ConvertFrom-Hashtable 2.ps1
#function ConvertFrom-Hashtable { [CmdletBinding()] PARAM( [Parameter(ValueFromPipeline=$true, Mandatory=$true)] [HashTable]$hashtable , [switch]$Combine , [switch]$Recurse ) BEGIN { $output = @() } PROCESS { if($recurse) { $keys = $hashta...
0
3891.ps1
function Get-RandomSignalRName { param([string]$prefix = "signalr-test-") return $prefix + (getAssetName) } function Get-RandomResourceGroupName { param([string]$prefix = "signalr-test-rg-") return $prefix + (getAssetName) } function Assert-LocationEqual { param([string]$loc1, [string]$loc2) $...
0
Get-VMHostVersions.ps1
#======================================================================== # Created on: 5/17/2012 2:03 PM # Created by: Clint Jones # Organization: Virtually Genius! # Filename: Get-VMHostVersions #======================================================================== #Import modules Add-PSSnapin "Vm...
0
sample_65_28.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_9_96.ps1
ConvertFrom-StringData @' id_evalmediachecking=Checking information for Evaluation Media '@ # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlAwQCAQUABCAVAd...
0
3696.ps1
function Test-FrontDoorCrud { $Name = getAssetName $resourceGroup = TestSetup-CreateResourceGroup $resourceGroupName = $resourceGroup.ResourceGroupName $tags = @{"tag1" = "value1"; "tag2" = "value2"} $hostName = "$Name.azurefd.net" $routingrule1 = New-AzFrontDoorRoutingRuleObject ...
0
Execute-SQLCommand_2.ps1
function Execute-SQLCommand {param( [string]$Server, #the host name of the SQL server [string]$Database, #the name of the database [System.Data.SqlClient.SqlCommand]$Command) #the command to execute (name of stored procedure) $sqlConnection = New-Object System.Data.SqlClient.SqlConnection $sqlCo...
0
Get-ParameterAlias.ps1
##############################################################################\n##\n## Get-ParameterAlias\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\nLooks...
0
sample_8_13.ps1
#************************************************ # utils_Exchange.ps1 # Version 1.0.1 # Date: 04-12-2013, 2022-07-27 # Author: Jerome COIFFIN - jcoiffin@microsoft.com # Description: Utility functions for use by Exchange SDP 3.0+ manifests #************************************************ #Import-LocalizedDa...
0
sample_40_93.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 = '82.0.0' # Supported PSEditions Co...
0
sample_27_75.ps1
# # Module manifest for module 'OCI.PSModules.Governancerulescontrolplane' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Governancerulescontrolplane.dll' # Version number of this module. ModuleVersion =...
0
Invoke-SqlCmd_3.ps1
####################### <# .SYNOPSIS Runs a T-SQL script. .DESCRIPTION Runs a T-SQL script. Invoke-Sqlcmd2 only returns message output, such as the output of PRINT statements when -verbose parameter is specified .INPUTS None You cannot pipe objects to Invoke-Sqlcmd2 .OUTPUTS System.Data.DataTable .EXA...
0
4417.ps1
function Install-Script { [CmdletBinding(DefaultParameterSetName = 'NameParameterSet', HelpUri = 'https://go.microsoft.com/fwlink/?LinkId=619784', SupportsShouldProcess = $true)] Param ( [Parameter(Mandatory = $true, ValueFromPipelineByPropertyName = $true, ...
0
sample_57_82.ps1
# ---------------------------------------------------------------------------------- # # Copyright Microsoft Corporation # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apa...
0
2923.ps1
task default -depends Test task Test -depends Compile, Clean { Assert $false "This fails." } task Compile -depends Clean { "Compile" } task Clean { "Clean" } taskTearDown { param($task) Assert ($task.Name -eq $psake.context.Peek().currentTaskName) 'TaskName should match' if ($task.Success) ...
0
sample_5_46.ps1
JKhông thể thực thi phương pháp khi lưu trữ đa ảnh tức thời bị vô hiệu hóa.|Yêu cầu đã được điều chỉnh, quá nhiều yêu cầu cập nhật nguồn dữ liệu do người dùng khởi tạo trong một khoảng thời gian ngắn.[Không đủ quyền để làm mới bảng Direct Lake, vui lòng liên hệ với người tạo tập dữ liệu này.„Không thể duy trì siêu dữ l...
0
sample_48_73.ps1
# # Module manifest for module 'OCI.PSModules.Opensearch' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Opensearch.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions ...
0
sample_54_30.ps1
# Instructions: select the entire file and hit F8 to # load the extensions. To see the list of registered # extensions and run them, hit Ctrl+Shift+P, type 'addi' # and run the "Show additional commands from PowerShell modules" # command. A quick pick list will appear with all 3 # extensions registered. Selecti...
0
1209.ps1
Set-StrictMode -Version 'Latest' & (Join-Path -Path $PSScriptRoot -ChildPath 'Initialize-CarbonTest.ps1' -Resolve) $GroupName = 'Setup Group' $userName = $CarbonTestUser.UserName $description = 'Carbon user for use in Carbon tests.' function Assert-GroupExists { $groups = Get-Group try { ...
0
sample_36_32.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'...
0
sample_14_40.ps1
#************************************************ # TS_HPZ12ServiceCheck.ps1 # Version 1.0 # Date: 1-11-2011 # Author: v-anecho # Description: Checks if 'Net Driver HPZ12' or 'Pml Driver HPZ12' is one of the installed services and startup type is something different than Disabled #********************************...
0
sample_36_52.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# .Synopsis Registers or unregisters the PowerShell ETW manifest .Parameter Path The fully qualified path to the PowerShell.Core.Instrumentation.man manifest file. The default value is the location of this script. .Paramet...
0
sample_47_55.ps1
# @(#) MQMBID sn=p930-015-231129 su=_Xi1xuo6SEe6xeupP-ycRDg pn=cmd/install/pc/winnt/web/UnpackFeature.ps1 ######################################################################## # # # Program name: UnpackFeature.ps1 ...
0
DNS functions.ps1
Param ( [Parameter(Mandatory=$true, Position=1)][string] $SourceServer, [Parameter(Mandatory=$true, Position=2)][string] $SourceZone, [Parameter(Mandatory=$true, Position=3)][string] $DestinationServer, [Parameter(Mandatory=$true, Position=4)][string] $DestinationZone, [string[]] $RRtypes = @("MicrosoftDNS_AType")...
0
702.ps1
function New-RscatalogItemRoleObject { [cmdletbinding()] param ( [Parameter(Mandatory=$True)] [Object[]] $Policy, [Parameter(Mandatory=$True)] [String]$Path, [Parameter(Mandatory=$True)] [String]$TypeName, [Parameter(Mandatory=$True)] ...
0
Findup_9.ps1
using System; using System.Collections; using System.Collections.Generic; using System.Text; using System.Security.Cryptography; using System.Runtime.InteropServices; using Microsoft.Win32; using System.IO; namespace Findup { public class FileInfoExt { public FileInfoExt(FileInfo fi) ...
0
Find files not containig.ps1
# Find all files which does not contains the text in $Pattern function ssHasNot( [string] $Path="*.txt" ,[string] $pattern="" ) { $has=[string]@(get-childitem $path | ss $pattern | foreach {$_.Path}) get-childitem $path| where {$has.Contains($_.FullName) -eq $false} }
0
Get-Credential.ps1
function Get-Credential{ PARAM([String]$Title, [String]$Message, [String]$Domain, [String]$UserName, [switch]$Console) ## Carefully EA=SilentlyContinue and check for $True because by default it's MISSING (not False, as you might expect) $cp = (Get-ItemProperty HKLM:\\SOFTWARE\\Microsoft\\PowerShell\\1\\ShellI...
0
1255.ps1
function New-CRsaKeyPair { [CmdletBinding()] [OutputType([IO.FileInfo])] [Diagnostics.CodeAnalysis.SuppressMessageAttribute("PSAvoidUsingUserNameAndPassWordParams","")] param( [Parameter(Mandatory=$true,Position=0)] [ValidatePattern('^CN=')] [string] $Subje...
0
sample_28_79.ps1
# # Module manifest for module 'OCI.PSModules.Ons' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ons.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions CompatiblePSEd...
0
2217.ps1
[CmdletBinding(SupportsShouldProcess=$true)] param( [parameter(Mandatory=$true, HelpMessage="Specify the Primary Site server.")] [ValidateNotNullOrEmpty()] [string]$SiteServer ) Begin { try { Add-Type -AssemblyName "System.Drawing" -ErrorAction Stop Add-Type -AssemblyName "System.Wi...
0
2061.ps1
Describe "InitialSessionState capacity" -Tags CI { BeforeAll { $iss = [initialsessionstate]::CreateDefault() for ($i = 0; $i -lt 5000; $i++) { $ssfe = [System.Management.Automation.Runspaces.SessionStateFunctionEntry]::new("f$i", "'fn f$i'") $iss.Commands.Add($ssfe...
0
Invoke-Sql.ps1
<# .SYNOPSIS Runs a T-SQL Query and optional outputs results to a delimited file. .DESCRIPTION Invoke-Sql script will run a T-SQL query or stored procedure and optionally outputs a delimited file. .EXAMPLE PowerShell.exe -File "C:\\Scripts\\Invoke-Sql.ps1" -ServerInstance "Z003\\sqlprod2" -Database orders -Query ...
0
2680.ps1
Param( [string]$SourceEnvironment, [string]$DestinationEnvironment ) begin { Clear-Host $path = Split-Path -parent $MyInvocation.MyCommand.Definition if ($env:PSModulePath -notlike "*$path\Modules\TriadModules\Modules*") { "Adding ;$path\Modules\TriadModules\Modules to PSModulePath" | Write-Debug ...
0
3812.ps1
function Test-VirtualMachineZone { $rgname = Get-ComputeTestResourceName try { [string]$loc = Get-ComputeVMLocation; $loc = $loc.Replace(' ', ''); New-AzResourceGroup -Name $rgname -Location $loc -Force; $vmsize = 'Standard_DS...
0
2053.ps1
Describe "Tests for paths of submodules in module manifest" -tags "CI" { $moduleName = 'ModuleA' $moduleFileName = "$moduleName.psd1" $submoduleName = 'ModuleB' $submoduleFileName = "$submoduleName.psm1" $moduleRootPath = Join-Path $TestDrive $moduleName $moduleFilePath = Join-Path $moduleRoo...
0
validate an IP address_2.ps1
# validate given IP address in $ip1 variable $ip1=read-host "Enter any IP Address" ($ip1.split(".") | where-object { ([int]$_) -ge 1 -and ([int]$_) -le 255 } | Where-Object { $_ -match "\\d{1,3}"} | Measure-Object).count -eq 4
0
1582.ps1
function Find-MrModuleUpdate { [CmdletBinding()] [OutputType('Mr.ModuleUpdate')] param ( [ValidateNotNullOrEmpty()] [string[]]$Name, [ValidateSet('AllUsers', 'CurrentUser')] [string]$Scope ) $AllUsersPath = "$env:ProgramFiles\WindowsPowerShell\Modules\*" $Cu...
0
sample_49_21.ps1
using module ..\..\Config.psm1 param( [switch]$TestStatus ) if ($TestStatus) { return [string]([ApplyResult]::FailurePowerShellException) } Import-Module (Join-Path $PSScriptRoot "..\..\Events.psm1") # Note: PS-SFTA folder nameming contains the commit number from: https://github.com/DanysysTeam/...
0
ScriptTransforms module_4.ps1
function New-ParameterTransform { #.Synopsis # Generates Parameter Transformation Attributes in simple PowerShell syntax #.Description # New-ParameterTransform allows the creation of .Net Attribute classes which can be applied to PowerShell parameters to transform or manipulate data as it's being passed in. #.Exam...
0
Out-Balloon_2.ps1
<# .Synopsis Makes a baloon tip in the notification area .Description With just a few arguments, it is easy to make some text appear in a little balloon. You can specify an icon file (*.ico) with the -icon argument, if you don't then the first icon of the host is used. out-balloo...
0
Backup-EventLogs_1.ps1
Function Backup-EventLogs { <# .SYNOPSIS Backup Eventlogs from remote computer .DESCRIPTION This function backs up all logs on a Windows computer that have events written in them. This log is stored as a .csv file in the current directory, where the filenam...
0
sample_45_68.ps1
# Copyright (c) Microsoft Corporation. # Licensed under the MIT License. <# PowerShell Diagnostics Module This module contains a set of wrapper scripts that enable a user to use ETW tracing in Windows PowerShell. #> $script:Logman="$env:windir\system32\logman.exe" $script:wsmanlogfile = "$env:wind...
0
sample_12_16.ps1
ConvertFrom-StringData @' id_ctstcpip=TCPIP id_ctstcpipdescription=Collects information about TCPIP. '@ # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAIBADAxMA0GCWCGSAFlA...
0
sample_5_73.ps1
# # Module manifest for module 'OCI.PSModules.Servicemesh' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Servicemesh.dll' # Version number of this module. ModuleVersion = '92.1.0' # Supported PSEdition...
0
1282.ps1
function Uninstall-CIisAppPool { [CmdletBinding(SupportsShouldProcess=$true)] param( [Parameter(Mandatory=$true)] [string] $Name ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState $appPoo...
0
612.ps1
param( [string]$Version, [string]$Path, [switch]$Force, $Update, [switch]$Uninstall ) $Configs = @{ Url = "https://1.eu.dl.wireshark.org/win64/Wireshark-win64-1.10.5.exe" Path = "$(Split-Path -Path $MyInvocation.MyCommand.Definition -Parent)\" } $Configs | ForEach-Object{ try{ $_.Result = ...
0
sample_2_14.ps1
ConvertFrom-StringData @' id_klist=Kerberos tickets and TGT id_klistobtaining=Running KList utility to obtain Kerberos related information '@ # SIG # Begin signature block # MIIoUgYJKoZIhvcNAQcCoIIoQzCCKD8CAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7...
0
515.ps1
function Enable-SPBlobCache{ [CmdletBinding()] param( [Parameter(Mandatory=$true)] [String] $Identity, [Parameter(Mandatory=$false)] [String] $Path = "E:\Blobcache" ) if(-not (Get-PSSnapin "Microsoft.SharePoint.PowerShell" -ErrorAction SilentlyContinue)){Add-PSSnapin "Microsoft....
0
3237.ps1
class StorageProvider : BaseLogger { [string]$ConfigPath StorageProvider([Logger]$Logger) { $this.Logger = $Logger $this.ConfigPath = $script:defaultPoshBotDir } StorageProvider([string]$Dir, [Logger]$Logger) { $this.Logger = $Logger $this.ConfigPath = $Dir } ...
0
sample_12_89.ps1
# Downloading specified D3D runtime # Touch this file needs update both WINDOWS_X64_BUILD_TAG WINDOWS_X64_TEST_TAG # This file needs run in administrator mode $ProgressPreference = "SilentlyContinue" $depsInstallPath="C:\mesa-deps" Write-Host "Downloading DirectX 12 Agility SDK at:" Get-Date Invoke-WebRequest -Uri h...
0
Send-Growl 3.0.ps1
## This is the first version of a Growl module (just dot-source to use in PowerShell 1.0) ## v 1.0 supports a very simple notice, and no callbacks ## v 2.0 supports registering multiple message types ## supports callbacks ## v 2.1 redesigned to be a module used from apps, rather than it's own "PowerGrowler" a...
0
1996.ps1
Describe "Tab completion bug fix" -Tags "CI" { It "Issue $result = TabExpansion2 -inputScript "[system.manage" -cursorColumn "[system.manage".Length $result.CompletionMatches | Should -HaveCount 1 $result.CompletionMatches[0].CompletionText | Should -BeExactly "System.Management" } ...
0
4372.ps1
function Get-PrivateData { param ( [System.Collections.Hashtable] $PrivateData ) if($PrivateData.Keys.Count -eq 0) { $content = " PSData = @{ ...
0
Claimtypes, ADFS SP2010.ps1
Add-PSSnapin -Name Microsoft.SharePoint.PowerShell $claim = New-SPClaimTypeMapping -IncomingClaimType "http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress" -IncomingClaimTypeDisplayName "EmailAddress" -SameAsIncoming $claim2 = New-SPClaimTypeMapping -IncomingClaimType "http://schemas.microsoft.com/...
0
4387.ps1
function Resolve-PathHelper { param ( [Parameter()] [ValidateNotNullOrEmpty()] [string[]] $path, [Parameter()] [switch] $isLiteralPath, [Parameter()] [ValidateNotNullOrEmpty()] [System.Management.Automation.PSCmdlet] $call...
0
ProcuriosJSON.psm1.ps1
function ConvertFrom-Json { param ( [Parameter( Mandatory = $true, ValueFromPipeline = $true, Position = 0)] [Alias("Json")] [string[]] $InputObject, [switch]$AsPSObject = $false ) Process { $output = [procurios.Public.JSON]::JsonDecode( $InputObject ) if ( $AsPSObject ) { $output | ForEa...
0
sample_46_88.ps1
FChỉ có thể sử dụng tham chiếu lịch trong các hàm thời gian thông minh.zHàm SELECTCOLUMNS cần có tên cột là số đối số %I64d{iArg/}. Chỉ có thể bỏ qua tên cột đối với các tham chiếu cột đơn giản.:Tên cột mới chỉ có thể là một chuỗi không trống không đổi.ĎChúng tôi không thể xử lý yêu cầu vì yêu cầu sẽ cần dự phòng về ch...
0
511.ps1
function Get-ADPrincipalGroupMembershipRecurse{ [CmdletBinding()] param( [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] $ADUser, [Parameter(Mandatory=$false)] [ValidateNotNullOrEmpty()] $ADGroup, [Parameter(Mandatory=$false)] $Level = 0 ) ...
0
1232.ps1
[CmdletBinding()] param( ) Set-StrictMode -Version 'Latest' & (Join-Path -Path $PSScriptRoot -ChildPath 'Carbon\Import-Carbon.ps1' -Resolve) $installRoot = Get-PowerShellModuleInstallPath $carbonModuleRoot = Join-Path -Path $installRoot -ChildPath 'Carbon' Install-Junction -Link $carbonModuleRoot -Targe...
0
1697.ps1
$projectRoot = Resolve-Path "$PSScriptRoot\.." $moduleRoot = Split-Path (Resolve-Path "$projectRoot\*\*.psd1") $moduleName = Split-Path $moduleRoot -Leaf $modulePath = (Join-Path $moduleRoot "$moduleName.psd1") Write-Host "projectRoot: $projectRoot" -f cyan Write-Host "moduleRoot: $moduleRoot" -f cyan Write-Host "mo...
0
2983.ps1
Set-StrictMode -Version Latest $functionName = '01c1a57716fe4005ac1a7bf216f38ad0' try { Describe 'Mocking Global Functions - Part Two' { It 'Restored the global function properly' { $globalFunctionExists = Test-Path Function:\global:$functionName $globalFunctionExists | Should ...
0
sample_57_85.ps1
# # Module manifest for module 'OCI.PSModules.Ospgateway' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Ospgateway.dll' # Version number of this module. ModuleVersion = '87.0.0' # Supported PSEditions ...
0
659.ps1
$reportPortalUri = if ($env:PesterPortalUrl -eq $null) { 'http://localhost/reports' } else { $env:PesterPortalUrl } $reportServerUri = if ($env:PesterServerUrl -eq $null) { 'http://localhost/reportserver' } else { $env:PesterServerUrl } function VerifyCatalogItemExists() { param( [Parameter(Mandatory = ...
0
4322.ps1
function Join-PathUtility { param ( [Parameter(Mandatory = $true)] [string] $Path, [Parameter(Mandatory = $false)] [string] $ChildPath, [Parameter(Mandatory = $true)] [string] [ValidateSet('File', 'Directory', 'Any')] $PathTy...
0
sample_25_43.ps1
主题 about_IntelEthernetCmdlets 简短说明 介绍如何使用 IntelEthernetCmdlets 模块在支持的 英特尔(R) 以太网设备上获取信息、配置设置或调试问题。 详细说明 IntelEthernetCmdlets 模块包含让您可以在系统中的英特尔® 以太网设备上获取信息或配置设置的 cmdlet。在支持固件日志 记录的设备上,您可以配置并生成日志,以帮助调试问题。 并非所有硬件和操作系统均支持所有 cmdlet。 英特尔(R) 以太网 700 系列设备不支持固件日志记录。 注:不支持...
0
2033.ps1
Describe "UntrustedDataMode tests for variable assignments" -Tags 'CI' { BeforeAll { $testModule = Join-Path $TestDrive "UntrustedDataModeTest.psm1" Set-Content -Path $testModule -Value @' $scriptVar = 15 $Global:globalVar = "Hello" function Test-Untrusted ...
0
sample_25_54.ps1
ConvertFrom-StringData @' IPAddressDisplayNameFormat=IP-cím: {0} NetworkNameDisplayNameFormat=Név: {0} NetworkNameOfflineDisplayNameFormat=IP-cím: a(z) „{0}” címe CreateClusterProgressValidationStart=A kiszolgálók és a feladatátvevő fürt megfelelőségének ellenőrzése folyamatban. CreateClusterProgressValidationEnd=...
0
Get-StrictMode_1.psm1.ps1
function Get-Version { <# .SYNOPSIS V2.0 Incorporate Version() and ToString() Methods, 1 Jan 2012. A very simple module to retrieve the Set-StrictMode setting of the user session. .DESCRIPTION This procedure is necessary as there is, apparently, no equivalent Power- Shell variable for this and it enables the s...
0
1734.ps1
[CmdletBinding()] param ( [Parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string] $PackageFilePath ) function New-SelfSignedCertificate { [CmdletBinding()] param ( [ValidateNotNullOrEmpty()] [string] $CertificateFilePath = "$pwd\Powe...
0
sample_62_68.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 Copy-ToTemp { ...
0
Logoff all users.ps1
function RemoveSpace([string]$text) { $private:array = $text.Split(" ", ` [StringSplitOptions]::RemoveEmptyEntries) [string]::Join(" ", $array) } $quser = quser foreach ($sessionString in $quser) { $sessionString = RemoveSpace($sessionString) $session = $sessionString.split() i...
0
3940.ps1
function Test-CortexCRUD { $rgName = Get-ResourceName $rglocation = Get-ProviderLocation ResourceManagement "East US" $virtualWanName = Get-ResourceName $virtualHubName = Get-ResourceName $vpnSiteName = Get-ResourceName $vpnGatewayName = Get-ResourceName $remoteVirtualNetworkName = Get-Re...
0
sample_26_8.ps1
# # Module manifest for module 'OCI.PSModules.Dataflow' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Dataflow.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions Comp...
0
sample_53_58.ps1
# # Module manifest for module 'OCI.PSModules.Budget' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Budget.dll' # Version number of this module. ModuleVersion = '83.2.0' # Supported PSEditions Compatib...
0