filename
stringlengths
5
142
content
stringlengths
2
26M
label
int64
0
1
3781.ps1
function Test-SyncGroup { $resourceGroupName = Get-ResourceGroupName Write-Verbose "RecordMode : $(Get-StorageTestMode)" try { $storageSyncServiceName = Get-ResourceName("sss") $syncGroupName = Get-ResourceName("sg") $resourceGroupLocation = Get-Resou...
0
10.100.5.32.ps1
function Set-IPAddress { param( [string]$networkinterface =$(read-host "Enter the name of the NIC (ie Local Area Connection)"), [string]$ip = $(read-host "Enter an IP Address (ie 10.10.10.10)"), [string]$mask = $(read-host "Enter the subnet mask (ie 255.255.255.0)"), [string]$gateway = $(read-host "Enter...
0
sample_64_1.ps1
# Localized ArchiveResources.psd1 ConvertFrom-StringData @' ###PSLOC PathNotFoundError=The path '{0}' either does not exist or is not a valid file system path. ExpandArchiveInValidDestinationPath=The path '{0}' is not a valid file system directory path. InvalidZipFileExtensionError={0} is not a supported archive...
0
sample_46_79.ps1
# # Module manifest for module 'OCI.PSModules.Healthchecks' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Healthchecks.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEditi...
0
1458.ps1
function Install-CCertificate { [CmdletBinding(SupportsShouldProcess=$true,DefaultParameterSetName='FromFileInWindowsStore')] [OutputType([Security.Cryptography.X509Certificates.X509Certificate2])] param( [Parameter(Mandatory=$true,Position=0,ParameterSetName='FromFileInWindowsStore')] ...
0
sample_16_57.ps1
$url = $args[0] Write-Host "Downloading Microsoft Edge Beta" $wc = New-Object net.webclient $msiInstaller = "$env:temp\microsoft-edge-beta.msi" $wc.Downloadfile($url, $msiInstaller) Write-Host "Installing Microsoft Edge Beta" $arguments = "/i `"$msiInstaller`" /quiet" Start-Process msiexec.exe -ArgumentList $argument...
0
sample_17_17.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
0
Asp_1.net-Using httpConext.ps1
Default.aspx ---------------- Partial Class _Default Inherits System.Web.UI.Page Dim var1 As String Dim var2 As String Protected Sub lnk_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles lnk.Click Context.Items("Nome") = var1 Context.Items("Email") = var2 Server.Transfer("pagina3.as...
0
sample_16_69.ps1
# # Module manifest for module 'OCI.PSModules.Emwarehouse' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Emwarehouse.dll' # Version number of this module. ModuleVersion = '77.0.0' # Supported PSEdition...
0
sample_64_3.ps1
@{ GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Start-Transcript", "Stop-Transcript" AliasesTo...
0
sample_15_72.ps1
# # Module manifest for module 'OCI.PSModules.Datascience' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Datascience.dll' # Version number of this module. ModuleVersion = '81.0.0' # Supported PSEdition...
0
sample_32_51.ps1
function Update-AzDataProtectionBackupInstanceAssociatedPolicy { [OutputType('Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Models.Api20240401.IBackupInstanceResource')] [CmdletBinding(PositionalBinding=$false, SupportsShouldProcess)] [Microsoft.Azure.PowerShell.Cmdlets.DataProtection.Description('...
0
sample_52_42.ps1
# ---------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # Code generated by Microsoft (R) AutoRest Code Generator. # Changes may c...
0
4264.ps1
$scriptblock = { function Invoke-MS16-032 { Param( [Parameter(ParameterSetName = "CustomCommand", Position = 0)] [String] $Command ) Set-StrictMode -Version 2 $RemoteScriptBlock = { [CmdletBinding()] Param( [Parameter(Position = 0, Mandatory = $true)] [String] $PEBytes64, [Parameter(...
0
sample_46_61.ps1
# # Module manifest for module 'OCI.PSModules.Appmgmtcontrol' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Appmgmtcontrol.dll' # Version number of this module. ModuleVersion = '73.1.0' # Supported PSE...
0
partial application.ps1
Set-StrictMode -Version 2 $commonParameters = @("Verbose", "Debug", "ErrorAction", "WarningAction", "ErrorVariable", "WarningVariable", "OutVariable", "OutB...
0
Get Exchange2003 Servers.ps1
[Array]$ExchSrvs = @("") [String]$StrFilter = "(objectCategory=msExchExchangeServer)" $objRootDSE = [ADSI]"LDAP://RootDSE" [String]$strContainer = $objRootDSE.configurationNamingContext $objSearcher = New-Object System.DirectoryServices.DirectorySearcher $objSearcher.SearchRoot = New-object System.DirectoryService...
0
sample_19_59.ps1
ConvertFrom-StringData @' id_sccm_activity_cm07serverinfo=Gathering Site Server Information id_sccm_cmserverinfo_boundary=Obtaining Boundaries id_sccm_cmserverinfo_cloud=Obtaining Cloud Services information '@ # SIG # Begin signature block # MIIoQwYJKoZIhvcNAQcCoIIoNDCCKDACAQExDzANBglghkgBZQMEAgEFADB5Bgor # Bg...
0
sample_63_2.ps1
ConvertFrom-StringData @' ###PSLOC DeployRole = Deploy '{0:RoleName}' role on '{1:MachineName}' machine. DeployRoleFailed = Deployment of '{0:RoleName}' role failed on '{1:MachineName}' machine with Error: {2:ErrorMessage}. CheckLogs = Check logs at '{0:FilePath}' on '{1:MachineName}' machine. ConfigureRole = Conf...
0
Split.ps1
function Split { <# .Synopsis Splits up a file into smaller files. .Description This function takes a file as input and splits it into files by a set number of lines. .Parameter filename The name of the file to be used as an input. This value can be piped to the function (see examples) .Parameter lines The n...
0
261.ps1
function Clean-MacAddress { [OutputType([String], ParameterSetName = "Upper")] [OutputType([String], ParameterSetName = "Lower")] [CmdletBinding(DefaultParameterSetName = 'Upper')] param ( [Parameter(ParameterSetName = 'Lower')] [Parameter(ParameterSetName = 'Upper')] [String]$MacAddress, [Parameter(Para...
0
sample_12_72.ps1
ConvertFrom-StringData @' id_ctsdnsserver=DNS Server id_ctsdnsserverdescription=Collects information about DNS Server. '@ # SIG # Begin signature block # MIIoOAYJKoZIhvcNAQcCoIIoKTCCKCUCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwEAAAQQH8w7YFlLCE63JNLG # KX7zUQIBAAIBAAIBAAIBAAI...
0
Get-Credential 2.4.ps1
## Get-Credential ## An improvement over the default cmdlet which has no options ... ################################################################################################### ## History ## v 2.4 Fix a bug in -Store when the UserName isn't passed in as a parameter ## v 2.3 Add -Store switch and support p...
0
sample_57_63.ps1
# # Module manifest for module 'OCI.PSModules.Oda' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Oda.dll' # Version number of this module. ModuleVersion = '87.0.0' # Supported PSEditions CompatiblePSEd...
0
sample_22_6.ps1
[CmdletBinding()] param () if (!(Test-Path "$PsScriptRoot\Modules")) { mkdir "$PsScriptRoot\Modules" | Out-Null } if (!(Test-Path "$PsScriptRoot\Modules\Az")) { Save-Module -Name Az -Repository PSGallery -Path "$PsScriptRoot\Modules\" } # SIG # Begin signature block # MIIoKgYJKoZIhvcNAQcCoIIoGzCC...
0
4007.ps1
$accountName='fbs-aa-01' $location = "East US" $resourceGroupName = "to-delete-01" function AssertContains { param([string] $str, [string] $substr, [string] $message) if (!$message) { $message = "Assertion failed because '$str' does not contain '$substr'" } if (!$str.Con...
0
4281.ps1
function Invoke-WMIExec { [CmdletBinding()] param ( [parameter(Mandatory=$true)][String]$Target, [parameter(Mandatory=$true)][String]$Username, [parameter(Mandatory=$false)][String]$Domain, [parameter(Mandatory=$false)][String]$Command, [parameter(Mandatory=$false)][String]$Password, [parameter...
0
BinaryClock V2.0.ps1
Function Start-BinaryClock { <# .SYNOPSIS This is a binary clock that lists the time in hours, minutes and seconds .DESCRIPTION This is a binary clock that lists the time in hours, minutes and seconds. Key Input Tips: r: Toggles the resize mode of the clock so you can adjust the size....
0
1677.ps1
function Add-LocalAdmin { param ( [string]$comp, [string]$sam, [string]$domain = $env:USERDOMAIN ) if ($comp -match '^\s*$') { throw "Comp not found '$comp'" } if ($sam -match '^\s*$') { throw "Sam not acceptable '$sam'" } ([adsi]"WinNT://$comp/Admi...
0
4349.ps1
function Get-ExternalModuleDependencies { Param ( [Parameter(Mandatory=$true)] [PSModuleInfo] $PSModuleInfo ) if($PSModuleInfo.PrivateData -and ($PSModuleInfo.PrivateData.GetType().ToString() -eq "System.Collections.Hashtable") -and $PSModuleInfo.PrivateData["PSData"] ...
0
132.ps1
function Get-AuthToken { [cmdletbinding()] param ( [Parameter(Mandatory=$true)] $User ) $userUpn = New-Object "System.Net.Mail.MailAddress" -ArgumentList $User $tenant = $userUpn.Host Write-Host "Checking for AzureAD module..." $AadModule = Get-Module -Name "AzureAD" -ListAvailable if ...
0
Get-Netstat _1.9.ps1
$null, $null, $null, $null, $netstat = netstat -a -n -o [regex]$regex = '\\s+(?<Protocol>\\S+)\\s+(?<LocalAddress>\\S+)\\s+(?<RemoteAddress>\\S+)\\s+(?<State>\\S+)\\s+(?<PID>\\S+)' $netstat | ForEach-Object { if ( $_ -match $regex ) { $process = "" | Select-Object Protocol, LocalAddress, Rem...
0
Snippet Compiler_1.ps1
#Require 2.0 $def = [Environment]::CurrentDirectory ################################################################################################## $mnuOpen_Click= { (New-Object Windows.Forms.OpenFileDialog) | % { $_.FileName = "source" $_.Filter = "C# (*.cs)|*.cs" $_.InitialDirectory = $d...
0
1529.ps1
[CmdletBinding()] param( ) Set-StrictMode -Version 'Latest' $ErrorActionPreference = 'Stop' & (Join-Path -Path $PSScriptRoot -ChildPath '..\Carbon\Import-Carbon.ps1' -Resolve) $installPath = Get-PowerShellModuleInstallPath $installPath = Join-Path -Path $installPath -ChildPath 'Carbon' $source = Join-P...
0
sample_35_71.ps1
<############################################################# # # # Copyright (C) Microsoft Corporation. All rights reserved. # # # #############################################################> ...
0
3383.ps1
$commands = function Test-SetAzureStorageBlobContent { Assert-ThrowsContains { Set-AzureStorageBlobContent -File "foo.txt" -Container foo -Blob foo -BlobType Block } "Could not get the storage context. Please pass in a storage context or set the current storage context." > $null } function Te...
0
e17dfa3f-0ecd-4124-a650-54cdf6ae6041.ps1
Get-WmiObject -Class Win32_MountPoint | where {$_.Directory -like ‘Win32_Directory.Name="D:\\\\MDBDATA*"’} | foreach { $vol = $_.Volume Get-WmiObject -Class Win32_Volume | where {$_.__RELPATH -eq $vol} | Select @{Name="Folder"; Expression={$_.Caption}}, @{Name="Server"; Expression={$_.SystemName}...
0
2965.ps1
Task ParallelTask1 { "ParallelTask1" } Task ParallelTask2 { "ParallelTask2" } Task ParallelNested1andNested2 { $jobArray = @() @("ParallelTask1", "ParallelTask2") | ForEach-Object { $jobArray += Start-Job { param($scriptFile, $taskName) Invoke-psake $scriptFile -ta...
0
Quest Dynamic Group 003.ps1
<# 2012.07.06 Information will be uploaded shortly. #>
0
sample_66_52.ps1
/*!----------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Version: 0.51.0(67d664a32968e19e2eb08b696a92463804182ae4) * Released under the MIT license * https://github.com/microsoft/monaco-editor/blob/main/LICENSE.txt *-------------...
0
sample_62_28.ps1
Get-Module | ForEach-Object { Remove-Module -Name $_.Name -Force } $PSModuleAutoloadingPreference = 'none' Import-Module Microsoft.PowerShell.Utility [void][System.Reflection.Assembly]::Load('System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a') [void][System.Reflection.Assembly]::Load...
0
sample_4_87.ps1
#************************************************ # TS_PrintingHPTCPMonCheck.ps1 # Version 1.0.1 # Date: 1-19-2012 # Author: v-anecho # Description: One or more network stored PST files were detected on this machine #************************************************ Import-LocalizedData -BindingVariable Script...
0
AD-PromiscDetect.ps1
<#================================================================================================ NAME: AD-PromiscDetect.ps1 AUTHOR: Marty J. Piccinich DATE CREATED: 9/15/2009 VERSION: 1.1 HISTORY: 1.0 9/15/2009 - Created 1.1 10/23/2009 - Added comment head...
0
NTFS ACLs Folder Tree_4.ps1
####################################### # TITLE: listACL.ps1 # # AUTHOR: Santiago Fernandez Mu&#241;oz # # # # DESC: This script generate a HTML # # report show all ACLs asociated with # # a Folder tree structure starting in # # root specified by the user...
0
485.ps1
function Remove-EnvironmentVariableValue{ [CmdletBinding()] param( [Parameter(Mandatory=$true)] [String] $Name, [Parameter(Mandatory=$true)] [String] $Value, [Parameter(Mandatory=$true)] [String] $Target, [Switch] $Clear ) [Environme...
0
2732.ps1
[CmdletBinding()] Param ( [Parameter(Mandatory=$false)] [int32]$BackMins=180 ) $BackTime=(Get-Date) - (New-TimeSpan -Minutes $BackMins) $RawEvents = Get-WinEvent -LogName "Microsoft-Windows-Sysmon/Operational" | Where-Object {$_.TimeCreated -ge $BackTime} | Where-Object { $_.Id -eq 3} $RawEvents | ForEach-Obje...
0
sample_52_97.ps1
$osInfo = Get-WmiObject -Class Win32_OperatingSystem # check if running on Windows Server if ($osInfo.ProductType -eq 3) { Install-WindowsFeature Server-Media-Foundation } # SIG # Begin signature block # MIIoKQYJKoZIhvcNAQcCoIIoGjCCKBYCAQExDzANBglghkgBZQMEAgEFADB5Bgor # BgEEAYI3AgEEoGswaTA0BgorBgEEAYI3AgEeMCYCAwE...
0
3218.ps1
describe 'New-PoshBotCardResponse' { BeforeAll { $imgUrl = 'https://github.com/poshbotio/PoshBot/raw/master/Media/poshbot_logo_300_432.png' $linkUrl = 'https://github.com/poshbotio/PoshBot' } it 'Returns a [PoshBot.Card.Response] object' { $resp = New-PoshBotCardResponse -Text 'ab...
0
sample_12_88.ps1
### # ==++== # # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # http://www.apache.org/licenses/LICENSE-2.0 # # Unless requi...
0
3621.ps1
function Test-GetMetrics { $rscname = 'subscriptions/56bb45c9-5c14-4914-885e-c6fd6f130f7c/resourceGroups/reactdemo/providers/Microsoft.Web/sites/reactdemowebapi' try { $actual = Get-AzMetric -ResourceId $rscname -starttime 2018-03-23T22:00:00Z -endtime 2018-03-23T22:30:00Z...
0
1143.ps1
$username = 'CarbonRevokePrivileg' $password = 'a1b2c3d4 function Start-TestFixture { & (Join-Path -Path $PSScriptRoot -ChildPath '..\Initialize-CarbonTest.ps1' -Resolve) } function Start-Test { Install-User -Username $username -Password $password -Description 'Account for testing Carbon Revoke-P...
0
sample_34_57.ps1
# Localized 06/28/2023 07:56 AM (GMT) 303:7.0.30723 cl_localizationdata.psd1 ConvertFrom-StringData @' ###PSLOC Troubleshoot_Title=Диагностика Troubleshoot_DetectNetworkCache=Проверка сетевого кэша проигрывателя Windows Media... Resolution_Title=Разрешение Resolution_ResetConfiguration=Сброс всех параметров конф...
0
sample_18_42.ps1
# Script: tss_ExportVPNProfiles.ps1 #region ::::: Script Input PARAMETERS ::::: #$ScriptVer="1.01" #Date: 2024-03-21 [CmdletBinding()]param( [Parameter(Mandatory=$true, Position=0)] [String] $PrefixTime, [Parameter(Mandatory=$true, Position=1)] [string] $TssPhase ) function CollectNET_VpnProfiles { # Get VPN...
0
2540.ps1
[String] $folder = "E:\Dexma\SQLIOTesting\"; [int] $runTimeSec = 60; [int] $fileSizeMb = 1000; [String[]] $stripFct = @("random", "sequential"); [int[]] $threads = @(1, 4, 16); [Char[]] $ioTypes = @("R", "W"); [int[]] $ioSizesKb = @(8, 64, 256, 512); [bool] $createHtml = $true; ...
0
2259.ps1
[CmdletBinding()] param( [parameter(Mandatory=$true)] $SiteServer, [parameter(Mandatory=$true)] $SiteCode ) function Validate-SiteCode { $ValidateSiteCode = Get-WmiObject -Namespace "root\SMS" -Class SMS_ProviderLocation -ComputerName $SiteServer -Filter "SiteCode like '$($SiteCode)'" | Select-Object -ExpandProper...
0
sample_45_60.ps1
# # Module manifest for module 'OCI.PSModules.Oda' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Oda.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported PSEditions CompatiblePSEd...
0
Show-Sample_1.ps1
if(!(Get-Command New-System.Windows.Input.CommandBinding -ErrorAction SilentlyContinue)) { Add-UIFunction -Type System.Windows.Input.CommandBinding } Show -Width 300 -Height 150 { DockPanel { Menu -DockPanel-Dock Top -Height 20 { MenuItem -Header "_File" { ## Hook up the "New" ...
0
sample_39_32.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
sample_64_50.ps1
# region Generated # Load the private module dll $null = Import-Module -PassThru -Name (Join-Path $PSScriptRoot '..\bin\Az.StackHCI.private.dll') # Load the internal module $internalModulePath = Join-Path $PSScriptRoot '..\internal\Az.StackHCI.internal.psm1' if(Test-Path $internalModulePath) { $n...
0
sample_9_28.ps1
#************************************************ # DC_RDSSH.ps1 # Version 1.0.1 # Date: 21-01-2012 # Author: Daniel Grund - dgrund@microsoft.com # Description: # This script gets the RDSSH config and # checks vital signs to inform user. # 1.0.0 Beta release #************************************************...
0
2004.ps1
Describe "ProviderIntrinsics Tests" -tags "CI" { BeforeAll { setup -d TestDir } It 'If a childitem exists, HasChild method returns $true' { $ExecutionContext.InvokeProvider.ChildItem.HasChild("$TESTDRIVE") | Should -BeTrue } It 'If a childitem does not exist, HasChild method return...
0
Get-Parameter_8.ps1
function Get-Parameter ( $Cmdlet, [switch]$ShowCommon, [switch]$Full ) { $command = Get-Command $Cmdlet -ea silentlycontinue # resolve aliases (an alias can point to another alias) while ($command.CommandType -eq "Alias") { $command = Get-Command ($command.definition) } if (-not $command) { return }...
0
2589.ps1
param ( $Server ); [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null; [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMOExtended")| Out-Null; function writeHtmlPage { param ($title, $heading, $body, $filePath); $html = "<html> ...
0
TheGameOfLife.ps1
[System.Reflection.Assembly]::LoadWithPartialName("System.Windows.Forms") | Out-Null $SCRIPT:hostProperties = @{}; $SCRIPT:hostState = $null; $SCRIPT:BoardWidth = 50; $SCRIPT:BoardHeight = 50; Function Initialize-Host { Param( [Parameter(Mandatory=$false)] $wndTitle = "Game of Life...", [Parameter(Ma...
0
512.ps1
function Get-ActiveDirectoryUserGroups{ param( [parameter(Mandatory=$true)] [string[]]$Users ) Import-Module Quest.ActiveRoles.ArsPowerShellSnapIn function New-ObjectADUserGroup{ param( $UserName, $UserDN, $UserSamAccountName, $GroupName, $GroupDN, $G...
0
4332.ps1
function ValidateAndGet-NuspecVersionString { param( [Parameter(Mandatory=$true)] [string] $Version ) $versionPattern = '^((?<MinRule>[\[\(])?((?<MinVersion>[^:\(\[\)\]\,]+))?((?<Comma>[\,])?(?<MaxVersion>[^:\(\[\)\]\,]+)?)?(?<MaxRule>[\]\)])?)$' $VersionInfo = @{} if ( -no...
0
Get-ProxyAddress.ps1
Param ( [Parameter(Mandatory=$true, Position=0, ValueFromPipeline=$true, HelpMessage="Enter SMTP address to search for in Active-Directory." )] [string]$objSMTP ) Function Get-ProxyAddresses ([string]$Address){ $objAD = $null $objAD = Get-QADObject -LdapFilter "(proxyAddre...
0
Set-Domain_7.ps1
function Set-Domain { param( [switch]$help, [string]$domain=$(read-host "Please specify the domain to join"), [System.Management.Automation.PSCredential]$credential = $(Get-Crdential) ) $usage = "`$cred = get-credential `n" $usage += "Set-Domain -domain MyDomain -credential `$cred`n" if ($help...
0
sample_47_68.ps1
# # Module manifest for module 'OCI.PSModules.Core' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Core.dll' # Version number of this module. ModuleVersion = '74.1.0' # Supported PSEditions CompatiblePS...
0
801.ps1
Get-Process -ComputerName "test-computer" function Get-Thing { [Alias()] [OutputType([int])] Param ( [Parameter(Mandatory=$true, ValueFromPipelineByPropertyName=$true, Position=0)] $Name ) Begin { } Process { return 0; } End { } } Get-Thing -Name "test"
0
Get-UIChildItem.ps1
#requires -version 2.0 [CmdletBinding()] param($Path) <# Quick check to see if we have necessary module... #> if (!(Get-Module ShowUI)) { try { Import-Module ShowUI } catch { Write-Warning "Can't load ShowUI module. I quit! For more details about error use -Verbose parameter....
0
sample_55_51.ps1
<UserControl x:Class="Avast.Net.Console.Network.Views.SoundsSettingsView" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:groupbox="clr-namespace:Groupbox;assembly=Groupbox" xmlns:ViewModels="clr-namespace:Avast...
0
Search Files by Date.ps1
<# Author: Matt Schmitt Date: 11/30/12 Version: 1.0 From: USA Email: ithink2020@gmail.com Website: http://about.me/schmittmatt Twitter: @MatthewASchmitt Description A script for finding files in a directory by Last Accessed Date. #> Write-Host "Enter Root Direc...
0
sample_31_85.ps1
# # Module manifest for module 'NetworkControllerFc' # # Generated by: vinodko # # Generated on: 1/31/2023 # @{ # Script module or binary module file associated with this manifest. RootModule = '' # Version number of this module. ModuleVersion = '1.1.0' # ID used to uniquely identify this module...
0
sample_12_0.ps1
@{ GUID="56D66100-99A0-4FFC-A12D-EEE9A6718AEF" Author="PowerShell" CompanyName="Microsoft Corporation" Copyright="Copyright (c) Microsoft Corporation." ModuleVersion="7.0.0.0" CompatiblePSEditions = @("Core") PowerShellVersion="3.0" FunctionsToExport = @() CmdletsToExport="Start-Transcript", "Stop-Transcript" AliasesTo...
0
sample_31_84.ps1
# # Module manifest for module 'OCI.PSModules.Loggingingestion' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Loggingingestion.dll' # Version number of this module. ModuleVersion = '80.0.0' # Supported...
0
sample_60_58.ps1
# # Module manifest for module 'OCI.PSModules.Databasetools' # # Generated by: Oracle Cloud Infrastructure # # @{ # Script module or binary module file associated with this manifest. RootModule = 'assemblies/OCI.PSModules.Databasetools.dll' # Version number of this module. ModuleVersion = '85.2.0' # Supported PSEdi...
0
Custom Accelerators CTP3.ps1
#requires -version 2.0 ## Custom Accelerators for PowerShell 2 (CTP3) #################################################################################################### ## A script module for CTP3 which allows the user to create their own custom type accelerators. ## Thanks to "Oisin Grehan for the discovery":ht...
0
Reflection Module _1.1.ps1
#requires -version 2.0 # ALSO REQUIRES Autoload for some functionality (Latest version: http://poshcode.org/3173) # You should create a Reflection.psd1 with the contents: # @{ ModuleToProcess="Reflection.psm1"; RequiredModules = @("Autoload"); GUID="64b5f609-970f-4e65-b02f-93ccf3e60cbb"; ModuleVersion="4.5.0.0" ...
0
1136.ps1
[CmdletBinding()] param( [Switch] $ForDsc ) Set-StrictMode -Version 'Latest' if( $env:COMPUTERNAME -eq $env:USERNAME ) { throw ('Can''t run Carbon tests. The current user''s username ({0}) is the same as the computer name ({1}). This causes problems with resolving identities, getting items fr...
0
Out-Html_2.ps1
################################################################################ # Out-HTML - converts cmdlets help to HTML format # Based on Out-wiki by Dimitry Sotnikov (http://dmitrysotnikov.wordpress.com/2008/08/18/out-wiki-convert-powershell-help-to-wiki-format/) # # Modify the invocation line at the bottom of...
0
2588.ps1
$dir = dir e:\dexma $dir |ConvertTo-Csv -Delimiter "`t" -NoTypeInformation|out-clipboard $excel = New-Object -ComObject Excel.Application $excel.visible = $true $workbook = $excel.Workbooks.Add() $range = $workbook.ActiveSheet.Range("b5","b$($dir.count + 5)") $workbook.ActiveSheet.Paste($range, $false) $workbook.SaveAs...
0
sample_14_89.ps1
function Deploy-Dependencies { param ( [string] $deploy_directory ) Write-Host "Copying libva runtime and driver at:" Get-Date # Copy the VA runtime binaries from the mesa built dependencies so the versions match with the built mesa VA driver binary $depsInstallPath="C:\mesa-deps" Copy-Item "$dep...
0
sample_44_7.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 = '80.0.0' # Supported PSEditions Comp...
0
sample_17_4.ps1
#************************************************ # TS_UnableToAddNetworkPrintersErrorCheck.ps1 # Version 1.0.1 # Date: 7/19/2013 # Author: v-kaw # Description: [KSE Rule] [ Windows V3] Presence of lots of folders inside \spool\prtprocs\ causes failure to install print queues # Rule number: d4047602-196c-443f-9...
0
Roll-Dice_1.ps1
# Roll-Dice.ps1 # Cody Bunch # ProfessionalVMware.com Begin { $rand = New-Object System.Random $dice = $rand.next(1,3) } Process { if ( $_ -isnot [VMware.VimAutomation.Types.Snapshot] ) { continue } if ($dice -gt 1) { $_ | Remove-Snapshot -Confirm:$false Write-Host "$_.Name OH NOES! Has been del...
0
1302.ps1
function Test-CPrivilege { [CmdletBinding()] param( [Parameter(Mandatory=$true)] [string] $Identity, [Parameter(Mandatory=$true)] [string] $Privilege ) Set-StrictMode -Version 'Latest' Use-CallerPreference -Cmdlet...
0
3305.ps1
function New-PoshBotInstance { [Diagnostics.CodeAnalysis.SuppressMessageAttribute('PSUseShouldProcessForStateChangingFunctions', '', Scope='Function', Target='*')] [cmdletbinding(DefaultParameterSetName = 'path')] param( [parameter( Mandatory, ParameterSetName = 'Path'...
0
PowerOAuth 1.0.ps1
#requires -Version 2.0 #requires -Module HttpRest -Version 1.2 # http`://poshcode.org/1262 Set-StrictMode -Version 2.0 $null = [Reflection.Assembly]::LoadWithPartialName('System.Web') $safeChars = [char[]]'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_.~' function Get-OAuthBase { #.Synopsis ...
0
Hardware Inventory_1.ps1
# Synopsis: # Windows Script to collect Hardware information on a local system # And Convert it to a JSON String and Upload that to a CouchDB # Database for newly installed servers. # Requirements: # -Local Admin Access in Powershell v2 # -ConvertTo-Json.ps1 Function # -SSL(443/TCP) allowed to CouchDB Host ...
0
531.ps1
function Get-SPUrl { param( [Parameter(Mandatory=$true)] $SPobject ) if($SPobject.PsObject.TypeNames -contains "System.String"){ [Uri]$Url = $SPobject if($Url -match "(/Forms/).*?\.(aspx$)"){ New-Object PSObject -Property @{...
0
221.ps1
function Get-SCSMWorkItemParent { [CmdletBinding()] PARAM ( [Parameter(ParameterSetName = 'GUID', Mandatory)] [Alias('ID')] $WorkItemGUID, [Parameter(ParameterSetName = 'Object', Mandatory)] $WorkItemObject ) BEGIN { IF (-not (Get-Module -Name Sm...
0
sample_34_67.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 = '77.0.0' # Supported PSEditions Compatib...
0
sample_41_25.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.2.0' # Sup...
0
sample_54_44.ps1
# Import the helper functions Import-Module $PSScriptRoot\..\..\Misc\helper.psm1 -Verbose:$false function Get-TargetResource { [CmdletBinding()] [OutputType([System.Collections.Hashtable])] param ( [parameter(Mandatory = $true)] [System.String] $Category ) #Write-Verbose "Use this cmdlet t...
0
Get-ChildItemRecurse.ps1
function Get-ChildItemRecurse { <# .Synopsis Does a recursive search through a PSDrive up to n levels. .Description Does a recursive directory search, allowing the user to specify the number of levels to search. .Parameter path The starting path. .Parameter fileglob (optional) the search string for ...
0
1500.ps1
function Assert-LastError { [CmdletBinding()] param( [Parameter(Mandatory=$true,Position=0)] [string] $ExpectedError, [Parameter(Position=1)] [string] $Message ) Set-StrictMode -Version 'Latest' Write-Warning 'O...
0
sample_40_69.ps1
# # Module manifest for module 'PSGet_AzStackHci.EnvironmentChecker' # # Generated by: Microsoft Corporation # # Generated on: 19/01/2022 # @{ # Script module or binary module file associated with this manifest. RootModule = '' # Version number of this module. ModuleVersion = '1.2100.2531...
0
sample_38_45.ps1
function Unzip-Product { if (-Not (Test-Path -Path "\$PSScriptRoot/version.txt")) { \$actualVersion = "" } else { \$actualVersion = Get-Content -Path "\$PSScriptRoot/version.txt" -Raw } if (\$actualVersion -ne "${version}") { Write-Host -NoNewline "Unzipping... " Expand-Archive -Pa...
0
sample_35_8.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 = '73.1.0' # Supported PSEditions Compatible...
0