filename
stringlengths
5
142
content
stringlengths
2
26M
label
int64
0
1
3678.ps1
function Test-FailoverDatabase { $location = Get-Location "Microsoft.Sql" "operations" "Southeast Asia" $rg = Create-ResourceGroupForTest $location $server = Create-ServerForTest $rg $location try { $databaseName = Get-DatabaseName New-AzSqlDatabase -ResourceGroupName $rg.ResourceGroupName...
0
Set-Blur.ps1
Add-Type -Type @" using System; using System.Runtime.InteropServices; namespace Huddled { public class Dwm { [DllImport("user32.dll")] public static extern int SetWindowLong(IntPtr hWnd, int nIndex, int dwNewLong); [DllImport("user32.dll", SetLastError=true)] public stati...
0
1743.ps1
param ( [string] $location = "/powershell", [string] $destination = '/mnt', [ValidatePattern("^v\d+\.\d+\.\d+(-\w+(\.\d+)?)?$")] [ValidateNotNullOrEmpty()] [string]$ReleaseTag, [switch]$TarX64, [switch]$TarArm, [switch]$TarArm64, [switch]$FxDependent, [switch]$Alpi...
0
4231.ps1
function Get-MSHotFixes { $hotfixes = Get-WmiObject -Class Win32_QuickFixEngineering $hotfixes | Select-Object -Property Description, HotfixID, Caption,@{l="InstalledOn";e={[DateTime]::Parse($_.psbase.properties["installedon"].value,$([System.Globalization.CultureInfo]::GetCultureInfo("en-US")))}} | Sort-Object -Desc...
0
sample_10_56.ps1
ConvertFrom-StringData @' id_bpastarting=Starting Best Practices Analyzer id_bparunning=Running Best Practices Analyzer id_bpagenerating=Generating BPA Output '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8...
0
sample_39_96.ps1
param ( [Parameter(Mandatory = $true)] [string] $VmName, [Parameter(Mandatory = $true)] [string] $VmUsername, [Parameter(Mandatory = $true)] [string] $VmPassword ) # Add Trusted Hosts try { Start-Service winrm -Verbose:$VerbosePreference $currentTrustedHosts = (Get-Item WSM...
0
Start-MyTranscript.ps1
function Start-MyTranscript { Param ( [Parameter(Mandatory=$true,Position=0)] [string] $Path )# of Param Process { $fileextension = "txt" $filenamePrefix = [System.DateTime]::Now.ToString("yyyy-MM-dd") $existingFiles = Get-ChildItem (Join-Path $Path "$filenamePrefix.*.Transcript.$fileextens...
0
1121.ps1
$siteName = 'SslFlags' $sitePort = 4389 $webConfigPath = Join-Path $TestDir web.config function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Start-Test { Uninstall-IisWebsite $siteName Install-IisWebsite -Name $siteName -Pa...
0
sample_4_56.ps1
# Name tss_FindUserBadPwdAttempts.ps1 <# .SYNOPSIS Script to find sAMAccountName, pwdLastSet, lockoutTime, DC, lastLogon, logonCount, badPwdCount, badPasswordTime for a username. .DESCRIPTION Script to assist in troubleshooting accounts experiencing bad password attempts. It can also be used to investiga...
0
LoadModuleConfig_2.ps1
################################################################################ ## Script Name: LoadModuleConfig ## Created On: 01/21/2010 ## Author: Thell Fowler ## File: LoadModuleConfig.ps1 ## Usage: Called from the NestedModules value from a module manifest. ## Version:...
0
sample_51_75.ps1
<# .SYNOPSIS Clean up log files from specified folders that are older than 30 days by default, but that can be overridden by a registry key. .DESCRIPTION Get all the files from the specified folders and recursively delete all files with creation date older than 30 days by default,...
0
Start-rdp_4.ps1
\nFunction Global:Start-RDP {\n<#\n .Synopsis\n This Cmdlet starts a microsoft terminal session against the hostname provided.\n \n it is possible to collect credential information from a PSCredential file saved on the disk\n \n .Description \n This cmdlet starts a Microsoft terminal sesion against the hostname pro...
0
Find-Replace.ps1
<# .SYNOPSIS Finds and Replaces multiple entries, in multiple files. .DESCRIPTION By default, performs an ordinal (case-sensitive and culture-insensitive) search to find an old value and replace it. .PARAMETER Path One or more files Paths to process. Excepts values from the Pipeline. Will except the output fr...
0
sample_7_15.ps1
# diag_sha.psm1 # Created by tdimli # March 2020 # # Diagnostic functions for SHA area # version $SHA_version = "1.0.200425.0" # Area and Area/Component arrays # Example: $AREA = @("Component1", "Component2") $SHA = @() #Component/Diagnostic Function arrays # Example: $Component1 = @("Diag_Func1", "Dia...
0
sample_1_2.ps1
ConvertFrom-StringData @' id_ctsnetworkstoreinterface=Network Store Interface id_ctsnetworkstoreinterfacedescription=Collects information about the Network Store Interface component. '@ # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCCKBcCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgE...
0
3058.ps1
Set-StrictMode -Version Latest InModuleScope Pester { Describe "Should -BeLikeExactly" { It "passes for things that are like wildcard" { "foobar" | Should BeLikeExactly "*ob*" "foobar" | Should -BeLikeExactly "*ob*" } It "fails for strings with different case" { ...
0
Decrypt Psi Password.ps1
function decrypt-psi ($jid, $pw) { $OFS = ""; $u = 0; for($p=0;$p -lt $pw.Length;$p+=4) { [char]([int]"0x$($pw[$p..$($p+3)])" -bxor [int]$jid[$u++]) } } $accounts = ([xml](cat ~\\psidata\\profiles\\default\\accounts.xml))["accounts"]["accounts"] foreach($account in ($accounts | gm a[0-9]*)) { ...
0
2084.ps1
Describe 'Classes inheritance syntax' -Tags "CI" { It 'Base types' { class C1 {} class C2a : C1 {} class C2b:C1 {} [C2a]::new().GetType().BaseType.Name | Should -Be "C1" [C2b].BaseType.Name | Should -Be "C1" } It 'inheritance from abstract base class with no abs...
0
sample_51_14.ps1
########################################################### # # 'GCArcService' module # ########################################################### $ErrorActionPreference = 'Stop' Set-StrictMode -Version Latest Import-Module "$PSScriptRoot\ServiceHelper.psm1" $script:GCInstallPath = "$PSScriptRoot\..\..\...
0
4342.ps1
function Get-InstallationScope() { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string]$PreviousInstallLocation, [Parameter(Mandatory=$true)] [string]$CurrentUserPath ) if ( -not $PreviousInstallLocation.ToString().StartsWith($currentUserPath, [System.Stri...
0
1751.ps1
Import-Module $PSScriptRoot/Apache/Apache.psm1 Write-Host -Foreground Blue "Get installed Apache Modules like *proxy* and Sort by name" Get-ApacheModule | Where-Object {$_.ModuleName -like "*proxy*"} | Sort-Object ModuleName | Out-Host Write-host -Foreground Blue "Restart Apache Server gracefully" Restart-Apache...
0
Set-Computername_14.ps1
function Set-ComputerName { param( [switch]$help, [string]$originalPCName=$(read-host "Please specify the current name of the computer"), [string]$computerName=$(read-host "Please specify the new name of the computer")) $usage = "set-ComputerName -originalPCname CurrentName -computername AnewName" if (...
0
sample_65_64.ps1
[CmdletBinding()] param ( [string]$OutFile, [string]$AltDownload, [string]$Proxy, [string]$AltHisEndpoint ) $ErrorActionPreference = 'Stop' $ProgressPreference = 'SilentlyContinue' $refVersion = [version] '4.5' $provider = 'Microsoft.HybridCompute' # Error codes used by azcmagent are in r...
0
2050.ps1
Describe "Adapter Tests" -tags "CI" { Context "Property Adapter Tests" { BeforeAll { $pso = [System.Diagnostics.Process]::GetCurrentProcess() $processName = $pso.Name if(-not ('TestCodeMethodClass' -as "type")) { class TestCodeMethodClass {...
0
3213.ps1
[CmdletBinding()] param( [switch] $Clean, [switch] $Bootstrap, [switch] $Test, [ValidateSet("Debug", "Release")] [string] $Configuration = "Debug", [ValidateSet("net461", "netcoreapp2.1")] [string] $Framework ) if ($Clean) { try { Push-Location $PSScrip...
0
elevate-process (sudo)_1.ps1
function elevate-process { $file, [string]$arguments = $args; $psi = new-object System.Diagnostics.ProcessStartInfo $file; $psi.Arguments = $arguments; $psi.Verb = "runas"; $psi.WorkingDirectory = get-location; [System.Diagnostics.Process]::Start($psi); } set-alias sudo elevate-process;
0
sample_49_31.ps1
# SharePoint references that need to remove when uninstall $ReferencesToRemoveWhenUninstall = @( @("System.IdentityModel.Tokens.Jwt"), @("Microsoft.IdentityModel.Tokens") ) # SharePoint references that need to be copy local $CopyLocalReferences = @( @("System.IdentityModel.Tokens.Jwt"), @("Mic...
0
1707.ps1
function Update-ServiceNowIncident { Param ( [parameter(mandatory=$true)] [parameter(ParameterSetName='SpecifyConnectionFields', mandatory=$true)] [parameter(ParameterSetName='UseConnectionObject', mandatory=$true)] [parameter(ParameterSetName='SetGlobalAuth', mandator...
0
sample_53_50.ps1
# # Module manifest for module 'OCI.PSModules.Marketplacepublisher' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Marketplacepublisher.dll' # Version number of this module. ModuleVersion = '82.0.0' # S...
0
sample_26_17.ps1
# # Module manifest for module 'Microsoft.SME.NetworkSettings' # @{ # Script module or binary module file associated with this manifest. RootModule = 'Microsoft.SME.NetworkSettings.psm1' # Version number of this module. ModuleVersion = '4.11.0' # Supported PSEditions # CompatiblePSEditions = @() # I...
0
176.ps1
function Enable-RemoteDesktop { [CmdletBinding(DefaultParameterSetName = 'CimSession', SupportsShouldProcess = $true)] param ( [Parameter(ParameterSetName = 'Main', ValueFromPipeline = $true, ValueFromPipelineByPropertyName = $true)] ...
0
sample_50_85.ps1
# # Module manifest for module 'OCI.PSModules.Osubsubscription' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Osubsubscription.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported...
0
Set-OutlookSignature.ps1
###########################################################################" # # NAME: Set-OutlookSignature.ps1 # # AUTHOR: Jan Egil Ring # # COMMENT: Script to create an Outlook signature based on user information from Active Directory. # Adjust the variables in the "Custom variables"-section # ...
0
3769.ps1
function Test-NewIntegrationAccountAssembly { $localAssemblyFilePath = Join-Path (Join-Path $TestOutputRoot "Resources") "SampleAssembly.dll" $assemblyContent = [IO.File]::ReadAllBytes($localAssemblyFilePath) $resourceGroup = TestSetup-CreateResourceGroup $integrationAccountName = "IA-" + (getAssetn...
0
sample_41_84.ps1
param([string] $AgentInstallDir) #Get the agent updater module path using intallation directory details $AgentInstallDir=$AgentInstallDir.Trim() $AgentUpdaterModulePath=Join-Path -Path $AgentInstallDir -ChildPath "Kailani.Afs.Updater.Cmdlets.dll" Write-Host "Running the agent updater action from $AgentUpdaterModu...
0
sample_64_80.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 = '83.3.0' # Supported PSEditions CompatiblePSEd...
0
sample_26_65.ps1
# Copyright (C) Intel Corporation, 2007 - 2019 All Rights Reserved. Function Get-AMTAccessMonitor { <# .Synopsis Returns Intel Active Management Technology access events .Description This Cmdlet returns the Intel Active Management Technology (AMT) access events from clients that have Intel Active Ma...
0
1806.ps1
Describe "Validate basic Variable provider cmdlets" -Tags "CI" { BeforeAll { $testVarName = "MyTestVarThatWontConflict" $testVarValue = 1234 $testVarDescription = "This is a test variable for provider test purposes." } BeforeEach { New-Variable -Name $testVarName -Value $t...
0
Get-SharePointListItem.ps1
#requires -Assembly System.Web #requires -Assembly System.Web.Services #.Example # Get-SPListItem "Scrum Team Assignments" # Gets all the items in the list with the default columns on them #.Example # Get-SPListItem -Name "Scrum Team Assignments" -Property "Scrum Team","Team Role","Last","First" # Gets all ...
0
sample_56_62.ps1
$timestamp = get-date -uformat %Y%m%d-%k%M%S $transcriptPath = "$($env:temp)\StorageSyncAgent-SetRegPIIAclSettings-$($timestamp).log" Start-Transcript -Path $transcriptPath # The following script removes read permissions from registry key locations which may contain PII information. $regPaths = 'HKLM:\Software\Mi...
0
PowerChart _1.5.ps1
function New-PowerChart() { [CmdletBinding(DefaultParameterSetName='DataTemplate')] param( [Parameter(Position=0, Mandatory=$true)] [ValidateSet("Area","Bar","Bubble","Column","Line","Pie","Scatter")] [String[]] ${ChartType} , [Parameter(Position=1, Mandatory=$true, HelpMessage='The data for...
0
sample_22_31.ps1
function trySetDesignerProp(tname, ttype, val) { var trait = document.designerProps.getOrCreateTrait(tname, ttype, 0); trait.value = val; } if (command.getTrait("state").value == 0) { command.getTrait("state").value = 2; trySetDesignerProp("embedMedia", "bool", true); } else { command.get...
0
Test-WebDAV_2.ps1
function Test-WebDav () { param ( $Url = "$( throw 'URL parameter is required.')" ) $xhttp = New-Object -ComObject msxml2.xmlhttp $xhttp.open("OPTIONS", $url, $false) $xhttp.send() if ( $xhttp.getResponseHeader("DAV") ) { $true } else { $false } }
0
Set-Computername_16.ps1
function Set-ComputerName { param( [switch]$help, [string]$originalPCName=$(read-host "Please specify the current name of the computer"), [string]$computerName=$(read-host "Please specify the new name of the computer")) $usage = "set-ComputerName -originalPCname CurrentName -computername AnewName" if (...
0
860.ps1
function Start-MapReduce { $ErrorActionPreference = "Stop" $context = Get-AzContext if ($context -eq $null) { Connect-AzAccount } $context $clusterName = Read-Host -Prompt "Enter the HDInsight cluster name" $creds=Get-Credential -Message "Enter the login for...
0
sample_26_35.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_40_28.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("snap",...
0
3261.ps1
class ExceptionFormatter { static [pscustomobject]Summarize([System.Management.Automation.ErrorRecord]$Exception) { return [pscustomobject]@{ CommandName = $Exception.InvocationInfo.MyCommand.Name Message = $Exception.Exception.Message TargetObject = $Exception.TargetOb...
0
sample_30_93.ps1
# # Module manifest for module 'OCI.PSModules.Streaming' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Streaming.dll' # Version number of this module. ModuleVersion = '79.0.0' # Supported PSEditions Co...
0
sample_23_9.ps1
using module ..\..\Config.psm1 param( [switch]$TestStatus ) Import-Module (Join-Path $PSScriptRoot "..\..\Events.psm1") Set-Variable -Option Constant -Name SkypeSettingsPath -Value "Registry::HKLM\SOFTWARE\Microsoft\PPI\SkypeSettings" Set-Variable -Option Constant -Name IsInstalled -Value "IsT21Installe...
0
get-ESXiHostConfigBackup_1.ps1
<# .SYNOPSIS Creates config bundle backup for ESXi hosts. Works where 80 is blocked to ESXi host Originally script by Alan Renouf (http://www.virtu-al.net/2011/02/23/backing-up-the-esxi-system-image) Heavily Modified by Jimmy Hester .DESCRIPTION Checks for connection to a vCenter or ESXi server If not connected...
0
3762.ps1
function CurrentApiVersion { return "2018-07-01-preview" } function SampleMetadata { return @{ "key1" = "value1"; "key2" = "value2"; "key3" = "value3"; } } function TestSetup-CreateResourceGroup { $resourceGroupName = "RG-" + (getAssetname) $location = Get-Location "Microsoft.Resources" "resour...
0
2946.ps1
Framework '4.6.2' task default -depends MsBuild task MsBuild { if ( $IsMacOS -OR $IsLinux ) {} else { $output = &msbuild /version /nologo 2>&1 Assert ($output -NotLike '14.0') '$output should contain 14.0' } }
0
sample_1_85.ps1
#************************************************ # DC_AuditPol.ps1 # Version 1.0.2 # Date: 09-22-2009 # Author : David Fisher - davfish@microsoft.com # Author (PS) : Andre Teixeira - andret@microsoft.com # Description: run auditpol subcommands and obtain output #********************************************...
0
Set-OCSUser.ps1
###########################################################################" # # NAME: Set-OCSUser.ps1 # # AUTHOR: Jan Egil Ring # EMAIL: jan.egil.ring@powershell.no # # COMMENT: Requires Quest AD cmdlets. This oneliner sets Active Directory user attributes for Microsoft Office Communications Server 2007. # ...
0
sample_18_28.ps1
@{ GUID = 'A51E6D9E-BC14-41A7-98A8-888195641250' Author="Microsoft Corporation" CompanyName="Microsoft Corporation" Copyright="Copyright (C) Microsoft Corporation. All rights reserved." ModuleVersion = '1.0' NestedModules = @('MSFT_MpPerformanceRecording.psm1') FormatsToProcess = @(...
0
validate an IP address_1.ps1
# validate given IP address in $ip1 variable $ip1 = "192.168.22.455" ($ip1.split(".") | where-object { $_ -ge 1 -and $_ -le 255 } | Where-Object { $_ -match "\\d{1,3}"} | Measure-Object).count -eq 4
0
Autoload Module.ps1
#Requires -Version 2.0 ## Automatically load functions from scripts on-demand, instead of having to dot-source them ahead of time, or reparse them from the script every time. ## Provides significant memory benefits over pre-loading all your functions, and significant performance benefits over using plain scripts. Ca...
0
826.ps1
$cred = Get-Credential $resourceGroupName = "myResourceGroup" $scaleSetName = "myScaleSet" $location = "EastUS" New-AzResourceGroup -ResourceGroupName $resourceGroupName -Location $location $subnet = New-AzVirtualNetworkSubnetConfig ` -Name "mySubnet" ` -AddressPrefix 10.0.0.0/24 $vnet = New-AzVirtualNetwo...
0
1879.ps1
Describe "Update-TypeData basic functionality" -Tags "CI" { BeforeAll { $testfilename = "testfile.ps1xml" $testfile = Join-Path -Path $TestDrive -ChildPath $testfilename $invalidFileExtensionFile = Join-Path -Path $TestDrive -ChildPath "notmshxml" $xmlContent=@" <Types> ...
0
DriveUtilization.ps1
Function Get-Utilization { Param([string]$computername=$env:computername, [string]$ID="C:" ) #suppress errors messages $errorActionPreference="silentlycontinue" $drive=Get-WmiObject Win32_Logicaldisk -filter "DeviceID='$ID'" ` -computerna...
0
sample_38_19.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 = '81.0.0' # Supported PSEditions Compatible...
0
sample_30_99.ps1
# # Module manifest for module 'OCI.PSModules.Opa' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Opa.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEditions CompatiblePSEd...
0
sample_43_84.ps1
# # Module manifest for module 'OCI.PSModules.Integration' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Integration.dll' # Version number of this module. ModuleVersion = '82.0.0' # Supported PSEdition...
0
sample_55_18.ps1
function PSConsoleHostReadLine { Microsoft.PowerShell.Core\Set-StrictMode -Off [Microsoft.PowerShell.PSConsoleReadLine]::ReadLine($host.Runspace, $ExecutionContext) } # SIG # Begin signature block # MIIoLQYJKoZIhvcNAQcCoIIoHjCCKBoCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgE...
0
4467.ps1
$script:helperModuleName = 'PowerShellGet.ResourceHelper' $resourceModuleRoot = Split-Path -Path (Split-Path -Path $PSScriptRoot -Parent) -Parent $dscResourcesFolderFilePath = Join-Path -Path (Join-Path -Path $resourceModuleRoot -ChildPath 'Modules') ` -ChildPath $script:helperModuleName Import-Module -Name (J...
0
Easy Migration Tool v_1.1.ps1
#Generated Form Function function GenerateForm { ######################################################################## # Code Generated By: Richard Yaw # Generated On: 09/12/2010 # # Easy Migration Script for VMware (Version 2.1) # - Added a "Reload Tasks" feature. # - Fixed issue with the Undo feature for S...
0
f316d247-86b3-4eee-b61f-313e456fe5d5.ps1
# This is to remove the Hidden folder attribute and delete the autorun.inf and x.mpeg due to changeup virus! # 4-3-2013 John R Remillard # You need the exact root folder path to unhide and delete the proper files and folders. #$Pth = Read-Host "Enter full path to unhide" $Lst = Get-Content c:\\Shares.txt foreach (...
0
3103.ps1
param( [switch]$SkipCabs, [switch]$ShowProgress ) $global:ProgressPreference = 'SilentlyContinue' if ($ShowProgress) { $ProgressPreference = 'Continue' } [Net.ServicePointManager]::SecurityProtocol = [Net.ServicePointManager]::SecurityProtocol -bor [Net.SecurityProtocolType]::Tls12 $tempDir = [System.IO.Path...
0
1730.ps1
function Get-ServiceNowTable { [OutputType([System.Management.Automation.PSCustomObject])] [CmdletBinding(DefaultParameterSetName, SupportsPaging)] Param ( [parameter(Mandatory = $true)] [ValidateNotNullOrEmpty()] [string]$Table, [Parameter(Mandatory = $f...
0
3127.ps1
function Get-WLANProfile { [CmdletBinding()] param( [Parameter( Position=0, HelpMessage='Indicates that the password appears in plain text')] [Switch]$ShowPassword, [Parameter( Position=1, HelpMessage='Filter WLAN-Profiles by Name or SSID')] [String]$Search, [Parameter( Position...
0
sample_63_64.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_1_26.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 = '93.0.0' # Supported PSEditions CompatiblePS...
0
Add-SqlTable_2.ps1
try {add-type -AssemblyName "Microsoft.SqlServer.ConnectionInfo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91" -EA Stop} catch {add-type -AssemblyName "Microsoft.SqlServer.ConnectionInfo"} try {add-type -AssemblyName "Microsoft.SqlServer.Smo, Version=10.0.0.0, Culture=neutral, PublicKeyToken=8...
0
1263.ps1
function Test-CFirewallStatefulFtp { [CmdletBinding()] param() Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet $PSCmdlet -Session $ExecutionContext.SessionState if( -not (Assert-CFirewallConfigurable) ) { return } $output = netsh advfirewall show g...
0
sample_67_26.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
Profile Function.ps1
######################################################## # This function will prompt the user asking if they want # to start a transcript file. It will loop until the user # types y or n. If the user selects y, the script will # check to see if the transcript exists. If it doesn't # it is created. If it does, the ...
0
sample_27_86.ps1
# # Script module for module 'Az.Monitor' that is executed when 'Az.Monitor' is imported in a PowerShell session. # # Generated by: Microsoft Corporation # # Generated on: 05/16/2024 06:33:08 # $PSDefaultParameterValues.Clear() Set-StrictMode -Version Latest function Test-DotNet { try { ...
0
sample_13_42.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
Get Active Sync devices .ps1
<# .SYNOPSIS Get-InactiveActiveSyncDevices pulls all user mailboxes with an Active Sync partnership and then selects the Active Sync devices that haven't synced in the specified period. These devices are sorted in ascending order and placed in a HTML table which is emailed to the specified user using a specified repl...
0
sample_22_75.ps1
<################################################### # # # Copyright (c) Microsoft. All rights reserved. # # # ##################################################> function Save-ComputerLogsBeforeRemoval { ...
0
sample_33_10.ps1
<# .SYNOPSIS SyncServiceIIS.ps1 script file This is a place-holder file only for agent patch build purposes #> Write-Host "This file functionality is deprecated and is place-holder only" # SIG # Begin signature block # MIInvwYJKoZIhvcNAQcCoIInsDCCJ6wCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3Ag...
0
sample_65_8.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
0
3162.ps1
Function Dump-AzureDomainInfo-MSOL { [CmdletBinding()] Param( [Parameter(Mandatory=$false, HelpMessage="Folder to output to.")] [string]$folder ) if ($folder){if(Test-Path $folder){if(Test-Path $folder"\MSOL"){}else{New-Item -ItemType Directory $folder"\MSOL"|Ou...
0
2545.ps1
function Test-PsRemoting { param( [Parameter(Mandatory = $true)] $computername ) try { $errorActionPreference = "Stop" $result = Invoke-Command -ComputerName $computername { 1 } } catch { Write-Host $computername $false return $false } ...
0
3959.ps1
function Test-LocalNetworkGatewayCRUD { $rgname = Get-ResourceGroupName $rname = Get-ResourceName $rglocation = Get-ProviderLocation ResourceManagement $resourceTypeParent = "Microsoft.Network/localNetworkGateways" $location = Get-ProviderLocation $resourceTypeParent try ...
0
ImaginaryFriendFeed_1.ps1
#.SYNOPSIS # A few functions for working with FriendFeed and Twitter #.DESCRIPTION # Allows you to copy your users from Twitter to imaginary FriendFeed users... #.EXAMPLE # ## Get any twitter friends who aren't on friendfeed # ## Make sure you use FriendFeed's built in "add all your twitter friends" first # $t...
0
1478.ps1
function Set-ModuleManifestMetadata { [CmdletBinding()] param( [Parameter(Mandatory=$true)] $ManifestPath, [string[]] $Tag, [string] $ReleaseNotesPath ) Set-StrictMode -Version 'Latest' $releaseNotes = Get-ModuleReleaseN...
0
NPS Server Synchronize_1.ps1
###Network Policy Server Synchronization Script #This script copies the configuration from the NPS Master Server and imports it on this server. #The Account that this script runs under must have Local Administrator rights to the NPS Master. #This was designed to be run as a scheduled task on the NPS Secondary Server...
0
Join-String.ps1
#.Synopsis # Joins array elements together using a specific string separator #.Example # $Env:Path = ls | ? {$_.PSIsContainer} | Select -expand FullName | Join ";" -Append $Env:Path #.Example # get-process | select -expand name | join "," # function Join-String { param ( [string]$separator, [string...
0
sample_12_20.ps1
#************************************************ # TS_SurfacePro3DetectWifiDriverVersion.ps1 # Version 1.0.09.19.14: Created and tested SurfacePro3 scripts from Sep12-19 # Version 1.1.10.09.14: Modified the detection method from file version to product version because the file version does not change between versio...
0
1048.ps1
& (Join-Path $TestDir ..\Initialize-CarbonTest.ps1 -Resolve) if( Test-AdminPrivilege ) { $originalTrustedHosts = $null function Start-Test { $originalTrustedHosts = @( Get-TrustedHost ) } function Stop-Test { if( $originalTrustedHosts ) { Set-T...
0
3165.ps1
function Test-Credential { [cmdletbinding(DefaultParameterSetName = 'Domain')] param( [parameter(ValueFromPipeline=$true)] [System.Management.Automation.PSCredential]$Credential = $( Get-Credential -Message "Please provide credentials to test" ), [validateset('Domain','Machine', '...
0
2338.ps1
[CmdletBinding(SupportsShouldProcess)] [OutputType('System.Management.Automation.PSCustomObject')] param ( [Parameter(Mandatory)] [string[]]$Group, [Parameter()] [ValidatePattern('\b[A-Z0-9._%+-]+@(?:[A-Z0-9-]+\.)+[A-Z]{2,4}\b')] [string]$Email = 'admin@lab.local', [Parameter()] [string]$...
0
sample_22_78.ps1
# # Module manifest for module 'OCI.PSModules.Vault' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Vault.dll' # Version number of this module. ModuleVersion = '75.1.0' # Supported PSEditions Compatible...
0
DefaultParameterValues_1.ps1
function Export-DefaultParameter { #.Synopsis # Exports the current default parameter values [CmdletBinding()] param( # The path to export default parameter values to (defaults to "DefaultParameterValues.clixml" in your profile directory) [String]$Path = $(Join-Path (Split-Path $Profile.CurrentUserAllHos...
0
sample_57_97.ps1
# # Module manifest for module 'OCI.PSModules.Desktops' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Desktops.dll' # Version number of this module. ModuleVersion = '87.0.0' # Supported PSEditions Comp...
0
sample_4_83.ps1
// Copyright (c) 2016 Dell Inc. or its subsidiaries. All Rights Reserved. // ================================================================== // DCIM_AccountCapabilities // ================================================================== [dynamic, provider("dcismprovider"), Association, Description ( ...
0
sample_54_85.ps1
# # Module manifest for module 'OCI.PSModules.Opa' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Opa.dll' # Version number of this module. ModuleVersion = '86.0.0' # Supported PSEditions CompatiblePSEd...
0
1597.ps1
Param($NumberOfDays = 30, [switch]$debug) if($debug) { $DebugPreference = " continue" } [timespan]$uptime = New-TimeSpan -start 0 -end 0 $currentTime = get-Date $startUpID = 6005 $shutDownID = 6006 $minutesInPeriod = (24*60)*$NumberOfDays $startingDate = (Get-Date -Hour 00 -Minute 00 -Second 00).adddays(...
0