full_path stringlengths 31 232 | filename stringlengths 4 167 | content stringlengths 0 48.3M |
|---|---|---|
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SVT/Services/LogicApps.ps1 | LogicApps.ps1 | Set-StrictMode -Version Latest
class LogicAppControl
{
[string] $Name = ""
[string] $Automated = ""
[string] $MethodName = ""
[string] $Remarks = ""
}
class LogicAppApprovedConnector
{
[string] $connectorName = ""
[LogicAppControl[]] $ApplicableControls = @()
[LogicAppControl[]] $NotApplicableContro... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/AzureMonitoring/OMSMonitoring.ps1 | OMSMonitoring.ps1 | Set-StrictMode -Version Latest
class OMSMonitoring: AzSdkRoot
{
[string] $OMSSubCCViewTemplateFilepath;
[string] $OMSAppCCViewTemplateFilepath;
OMSMonitoring([string] $subscriptionId):
Base([string] $subscriptionId)
{
#$this.PublishRunIdentifier();
$OMSSubCCViewTemplateFile = $this.L... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/ContinuousCompliance/CCAutomation.ps1 | CCAutomation.ps1 | using namespace System.Management.Automation
Set-StrictMode -Version Latest
class CCAutomation: CommandBase
{
hidden [AutomationAccount] $AutomationAccount
hidden [Runbook[]] $Runbooks = @()
hidden [string] $RunbookName = "Continuous_Assurance_Runbook"
hidden [RunbookSchedule[]] $RunbookSchedules = @()
h... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SubscriptionSecurity/ARMPolicy.ps1 | ARMPolicy.ps1 | using namespace System.Management.Automation
Set-StrictMode -Version Latest
# Class to implement Subscription ARM Policy controls
class ARMPolicy: CommandBase
{
hidden [PSObject[]] $Policy = $null;
hidden [PSObject[]] $ApplicableARMPolicies = $null;
#hidden [PSObject[]] $PolicyAssignments = $null;
... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SubscriptionSecurity/SecurityCenterStatus.ps1 | SecurityCenterStatus.ps1 | using namespace System.Management.Automation
Set-StrictMode -Version Latest
# The class serves as an intermediate class to call SecurityCenter class
# SecurityCenter class is being used in SubscriptionCore
class SecurityCenterStatus: CommandBase
{
SecurityCenterStatus([string] $subscriptionId, [Invocation... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SubscriptionSecurity/Alerts.ps1 | Alerts.ps1 | using namespace System.Management.Automation
Set-StrictMode -Version Latest
# Class to implement Subscription alert controls
class Alerts: CommandBase
{
hidden [PSObject[]] $Policy = $null;
hidden [PSObject[]] $ApplicableAlerts = $null;
hidden [string] $TargetResourceGroup;
hidden [string] $Re... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SubscriptionSecurity/SubscriptionSecurity.ps1 | SubscriptionSecurity.ps1 | using namespace System.Management.Automation
Set-StrictMode -Version Latest
# The class serves as an intermediate class to call multiple subscription security module classes
class SubscriptionSecurity: CommandBase
{
[string] $Tags
SubscriptionSecurity([string] $subscriptionId, [InvocationInfo] $invocat... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SubscriptionSecurity/RBAC.ps1 | RBAC.ps1 | using namespace Microsoft.Azure.Commands.Resources.Models.Authorization
using namespace System.Management.Automation
Set-StrictMode -Version Latest
# Class to implement Subscription RBAC controls
class RBAC: CommandBase
{
hidden [SubscriptionRBAC] $Policy = $null;
hidden [PSRoleAssignment[]] $RoleAss... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Core/SubscriptionSecurity/SecurityCenter.ps1 | SecurityCenter.ps1 | using namespace System.Management.Automation
Set-StrictMode -Version Latest
class SecurityCenter: AzSdkRoot
{
[PSObject] $Policy = $null;
[string] $Off = "Off";
[string] $On = "On";
SecurityCenter([string] $subscriptionId):
Base($subscriptionId)
{
$this.Policy = $this.LoadServerConf... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Configurations/ContinuousAssurance/Continuous_Assurance_Runbook.ps1 | Continuous_Assurance_Runbook.ps1 | function Set-Modules
{
param(
[System.Collections.IDictionary] $ModuleList,
[string[]] $SyncModuleList
)
$ModuleList.Keys | ForEach-Object{
$ModuleName = $_
$ModuleVersion = $ModuleList.Item($_)
$Module = Get-AzureRmAutomationModule `
-ResourceGroupName $AutomationAccount... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Managers/ControlStateExtension.ps1 | ControlStateExtension.ps1 | Set-StrictMode -Version Latest
class ControlStateExtension
{
hidden [PSObject] $AzSDKResourceGroup = $null;
hidden [PSObject] $AzSDKStorageAccount = $null;
hidden [PSObject] $AzSDKStorageContainer = $null;
hidden [PSObject] $ControlStateIndexer = $null;
hidden [int] $HasControlStateReadPermissions = -1;
... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Managers/ConfigurationManager.ps1 | ConfigurationManager.ps1 | Set-StrictMode -Version Latest
#
# ConfigManager.ps1
#
class ConfigurationManager
{
hidden static [AzSdkConfig] GetAzSdkConfigData()
{
return [AzSdkConfig]::GetInstance([ConfigurationManager]::GetAzSdkSettings().UseOnlinePolicyStore, [ConfigurationManager]::GetAzSdkSettings().OnlinePolicySt... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Listeners/ListenerHelper.ps1 | ListenerHelper.ps1 | Set-StrictMode -Version Latest
#Class to register appropriate listeners based on environment
class ListenerHelper
{
static ListenerHelper()
{
}
static [void] RegisterListeners()
{
[WriteFolderPath]::GetInstance().RegisterEvents();
[WriteDetailedLog]::GetInstance().RegisterEvents();
... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Listeners/RemoteReports/RemoteReportHelper.ps1 | RemoteReportHelper.ps1 | Set-StrictMode -Version Latest
class RemoteReportHelper
{
hidden static [string[]] $IgnoreScanParamList = "DoNotOpenOutputFolder";
hidden static [string[]] $AllowedServiceScanParamList = "SubscriptionId", "ResourceGroupNames";
hidden static [string[]] $AllowedSubscriptionScanParamList = "SubscriptionId";
hi... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Listeners/RemoteReports/VulnDataPublisher.ps1 | VulnDataPublisher.ps1 | Set-StrictMode -Version Latest
class VulnDataPublisher: ListenerBase {
hidden VulnDataPublisher() {
}
hidden static [VulnDataPublisher] $Instance = $null;
static [VulnDataPublisher] GetInstance() {
if ( $null -eq [VulnDataPublisher]::Instance ) {
[VulnDataPublisher]:... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Listeners/RemoteReports/TelemetryStrings.ps1 | TelemetryStrings.ps1 | Set-StrictMode -Version Latest
class TelemetryKeys {
static [string] $SubscriptionId = "SubscriptionId";
static [string] $SubscriptionName = "SubscriptionName";
static [string] $FeatureGroup = "FeatureGroup";
static [string] $Feature = "Feature";
static [string] $ResourceName = "ResourceName";... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Listeners/RemoteReports/UsageTelemetry.ps1 | UsageTelemetry.ps1 | Set-StrictMode -Version Latest
class UsageTelemetry: ListenerBase {
[Microsoft.ApplicationInsights.TelemetryClient] $TelemetryClient;
hidden UsageTelemetry() {
$this.TelemetryClient = [Microsoft.ApplicationInsights.TelemetryClient]::new()
$this.TelemetryClient.InstrumentationKey = [Constants]::UsageTe... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Listeners/RemoteReports/ControlTelemetry.ps1 | ControlTelemetry.ps1 | Set-StrictMode -Version Latest
class ControlTelemetry: ListenerBase {
[Microsoft.ApplicationInsights.TelemetryClient] $TelemetryClient;
hidden ControlTelemetry() {
$this.TelemetryClient = [Microsoft.ApplicationInsights.TelemetryClient]::new()
}
hidden static [ControlTelemetry] $Instance = $nu... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Listeners/UserReports/WriteDataFile.ps1 | WriteDataFile.ps1 | Set-StrictMode -Version Latest
class WriteDataFile: FileOutputBase
{
hidden static [WriteDataFile] $Instance = $null;
hidden [int] $JsonDepth = 10;
static [WriteDataFile] GetInstance()
{
if ( $null -eq [WriteDataFile]::Instance)
{
[WriteDataFile]::Instance = [... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Listeners/UserReports/WriteFolderPath.ps1 | WriteFolderPath.ps1 | Set-StrictMode -Version Latest
class WriteFolderPath: FileOutputBase
{
hidden static [WriteFolderPath] $Instance = $null;
static [WriteFolderPath] GetInstance()
{
if ($null -eq [WriteFolderPath]::Instance)
{
[WriteFolderPath]::Instance = [WriteFolderPath]::new();
... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Listeners/UserReports/WriteDetailedLog.ps1 | WriteDetailedLog.ps1 | Set-StrictMode -Version Latest
class WriteDetailedLog: FileOutputBase
{
hidden static [WriteDetailedLog] $Instance = $null;
static [WriteDetailedLog] GetInstance()
{
if ( $null -eq [WriteDetailedLog]::Instance)
{
[WriteDetailedLog]::Instance = [WriteDetailedLog]::new();... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Listeners/UserReports/WritePsConsole.ps1 | WritePsConsole.ps1 | Set-StrictMode -Version Latest
class WritePsConsole: FileOutputBase
{
hidden static [WritePsConsole] $Instance = $null;
static [WritePsConsole] GetInstance()
{
if ($null -eq [WritePsConsole]::Instance)
{
[WritePsConsole]::Instance = [WritePsConsole]::new();
}
... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Listeners/UserReports/WriteSummaryFile.ps1 | WriteSummaryFile.ps1 | Set-StrictMode -Version Latest
class WriteSummaryFile: FileOutputBase
{
hidden static [WriteSummaryFile] $Instance = $null;
static [WriteSummaryFile] GetInstance()
{
if ( $null -eq [WriteSummaryFile]::Instance)
{
[WriteSummaryFile]::Instance = [WriteSummaryFile]::n... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Listeners/OMS/OMSOutput.ps1 | OMSOutput.ps1 | Set-StrictMode -Version Latest
class OMSOutput: ListenerBase
{
hidden static [OMSOutput] $Instance = $null;
#Default source is kept as SDL / PowerShell.
#This value must be set in respective environment i.e. CICD,CC
[string] $OMSSource;
OMSOutput()
{
}
static [OMSOutput] GetInstan... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Abstracts/EventBase.ps1 | EventBase.ps1 | using namespace System.Management.Automation
Set-StrictMode -Version Latest
# Class for providing capability to fire events
# Also includes support to fire AzSdkGenericEvent and holds InvocationContext
class EventBase
{
[string] $RunIdentifier = "default";
[InvocationInfo] $InvocationContext;
[stri... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Abstracts/SVTCommandBase.ps1 | SVTCommandBase.ps1 | using namespace System.Management.Automation
Set-StrictMode -Version Latest
# Base class for SVT classes being called from PS commands
# Provides functionality to fire important events at command call
class SVTCommandBase: CommandBase
{
[string[]] $ExcludeTags = @();
[string[]] $ControlIds = @();
[Attest... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Abstracts/CommandBase.ps1 | CommandBase.ps1 | using namespace System.Management.Automation
Set-StrictMode -Version Latest
# Base class for all classes being called from PS commands
# Provides functionality to fire important events at command call
class CommandBase: AzSdkRoot
{
[string[]] $FilterTags = @();
CommandBase([string] $subscriptionId, [Invocati... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Abstracts/SVTBase.ps1 | SVTBase.ps1 | Set-StrictMode -Version Latest
class SVTBase: AzSdkRoot
{
hidden [string] $ResourceId = ""
[ResourceContext] $ResourceContext = $null;
hidden [SVTConfig] $SVTConfig
hidden [PSObject] $ControlSettings
#hidden [PSObject] $ControlStateIndexer = @()
#hidden [ControlState[]] $ControlStates =@()
#... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Abstracts/FileOutputBase.ps1 | FileOutputBase.ps1 | Set-StrictMode -Version Latest
class FileOutputBase: ListenerBase
{
static [string] $ETCFolderPath = "Etc";
[string] $FilePath = "";
[string] $FolderPath = "";
[string] $BasePath = "";
FileOutputBase()
{
[Helpers]::AbstractClass($this, [FileOutputBase]);
}
... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Abstracts/ListenerBase.ps1 | ListenerBase.ps1 | Set-StrictMode -Version Latest
class ListenerBase: EventBase
{
[array] $RegisteredEvents = @();
ListenerBase()
{
[Helpers]::AbstractClass($this, [ListenerBase]);
}
[void] SetRunIdentifier([AzSdkRootEventArgument] $arguments)
{
$data = $arguments.Messages | Se... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Abstracts/AzSdkRoot.ps1 | AzSdkRoot.ps1 | Set-StrictMode -Version Latest
class AzSdkRoot: EventBase
{
[SubscriptionContext] $SubscriptionContext;
AzSdkRoot([string] $subscriptionId)
{
[Helpers]::AbstractClass($this, [AzSdkRoot]);
#Set up subscription
$this.SubscriptionContext = [SubscriptionContext]@{... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Helpers/IdentityHelpers.ps1 | IdentityHelpers.ps1 | Set-StrictMode -Version Latest
class IdentityHelpers
{
hidden static [bool] IsServiceAccount($ObjectId, $SignInName, $ObjectType, $GraphAccessToken)
{
$return = $null
$header = "Bearer " + $GraphAccessToken
$RMContext = Get-AzureRmContext -ErrorAction Ignore
$headers = @{"Authorization"=$he... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Helpers/RoleAssignmentHelper.ps1 | RoleAssignmentHelper.ps1 | using namespace Microsoft.Azure.Commands.Resources.Models.Authorization
Set-StrictMode -Version Latest
class RoleAssignmentHelper
{
static [PSRoleAssignment[]] GetAzSDKRoleAssignmentByScope([string] $scope, [bool] $recurse, [bool] $includeClassicAdministrators)
{
[PSRoleAssignment[]] $roleAssignments = @();
... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Helpers/RemoteApiHelper.ps1 | RemoteApiHelper.ps1 | Set-StrictMode -Version Latest
class RemoteApiHelper {
# TODO: Move to config
hidden static [string] $ApiBaseEndpoint = [ConfigurationManager]::GetAzSdkConfigData().AzSDKApiBaseURL; #https://localhost:44380/api
hidden static [Newtonsoft.Json.JsonSerializerSettings] $SerializerSettings;
static R... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Helpers/SVTMapping.ps1 | SVTMapping.ps1 | Set-StrictMode -Version Latest
class SVTMapping
{
static [string] GetResourceTypeEnumItems()
{
return ([SVTMapping]::Mapping |
Where-Object { -not [string]::IsNullOrEmpty($_.ResourceTypeName) } |
ForEach-Object { "$($_.ResourceTypeName.Replace(' ', '')) `r`n" } |
Sort-Object);
}
... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Helpers/ConfigurationHelper.ps1 | ConfigurationHelper.ps1 | Set-StrictMode -Version Latest
#
# ConfigurationHelper.ps1
#
class ConfigurationHelper {
hidden static [PSObject] LoadOfflineConfigFile([string] $fileName) {
#Load file from AzSDK App folder
$rootConfigPath = [Constants]::AzSdkAppFolderPath + "\" ;
$extension = [System.IO.Path]::GetExtensi... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Helpers/Helpers.ps1 | Helpers.ps1 | using namespace Newtonsoft.Json
Set-StrictMode -Version Latest
class Helpers {
static AbstractClass($obj, $classType) {
$type = $obj.GetType()
if ($type -eq $classType) {
throw("Class '$type' must be inherited")
}
}
static [string] SanitizeFolderName($folderPat... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Helpers/SecurityCenterHelper.ps1 | SecurityCenterHelper.ps1 | using namespace Microsoft.Azure.Commands.Resources.Models.Authorization
Set-StrictMode -Version Latest
class SecurityCenterHelper
{
static [string] $PoliciesApi = "policies";
static [string] $AlertsApi = "alerts";
static [string] $TasksApi = "tasks";
static [string] $SecurityStatusApi = "securityStatuses";
... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Helpers/Constants.ps1 | Constants.ps1 | Set-StrictMode -Version Latest
class Constants
{
#All constant used across all modules Defined Here.
static [string] $DoubleDashLine = "================================================================================"
static [string] $HashLine = "###########################################... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Helpers/ActiveDirectoryHelper.ps1 | ActiveDirectoryHelper.ps1 | Set-StrictMode -Version Latest
class ActiveDirectoryHelper {
static [PSObject] GetADAppServicePrincipalByAppId($ApplicationId)
{
$TenantId = (Get-AzureRmContext -ErrorAction Stop).Tenant.TenantId
$ApiVersion = "1.6"
$GraphApiUrl = [WebRequestHelper]::GraphApiUri + $TenantId + "/servicePrincipals/{... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Helpers/WebRequestHelper.ps1 | WebRequestHelper.ps1 | Set-StrictMode -Version Latest
class WebRequestHelper {
hidden static [string] $AzureManagementUri = "https://management.azure.com/";
hidden static [string] $GraphApiUri = "https://graph.windows.net/";
hidden static [string] $ClassicManagementUri = "https://management.core.windows.net/";
static [Sys... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Models/AzSdkSettings.ps1 | AzSdkSettings.ps1 | #
# AzSdkSettings.ps1
#
Set-StrictMode -Version Latest
class AzSdkSettings {
[string] $OMSWorkspaceId;
[string] $OMSSharedKey;
[string] $OMSType;
[string] $OMSSource;
[bool] $EnableAADAuthForOnlinePolicyStore;
[bool] $UseOnlinePolicyStore;
[string] $OnlinePolicyStoreUrl;
[string] $Us... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Models/AzSdkGenericEvent.ps1 | AzSdkGenericEvent.ps1 | Set-StrictMode -Version Latest
class AzSdkGenericEvent
{
static [string] $CustomMessage = "AzSdk.Generic.CustomMessage"; #EventArgument: MessageData
static [string] $Exception = "AzSdk.Generic.Exception"; #EventArgument: ErrorRecord
}
class MessageDataBase
{
[string] $Message = "";
[PSObject... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Models/AzSdkConfig.ps1 | AzSdkConfig.ps1 | Set-StrictMode -Version Latest
class AzSdkConfig
{
[string] $MaintenanceMessage
[Environment] $Environment
[string] $AzSDKRGName
[string] $AzSDKRepoURL
[string] $AzSDKServerVersion
[string[]] $SubscriptionMandatoryTags = @()
[string] $ERvNetResourceGroupNames
[string] $UpdateCompatibleCCVersion
[... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Models/ControlState.ps1 | ControlState.ps1 | Set-StrictMode -Version Latest
class ControlState
{
ControlState()
{
}
ControlState([string]$ControlId, [string] $InternalId, [string] $ChildResourceName, [string] $ActualVerificationResult, [string]$Version)
{
$this.ControlId = $ControlId;
$this.InternalId = $InternalId;
$this.ChildResource... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Models/Enums.ps1 | Enums.ps1 | Set-StrictMode -Version Latest
enum VerificationResult
{
Manual
Passed
RiskAck
Verify
Failed
Error
Disabled
}
enum AttestationStatus
{
None
NotAnIssue
NotFixed
}
enum AttestControls
{
None
All
AlreadyAttested
NotAttested
}
enum MessageType
{
Critical
E... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Models/AzSdkEvent.ps1 | AzSdkEvent.ps1 | Set-StrictMode -Version Latest
class AzSdkRootEvent
{
static [string] $CustomMessage = "AzSdk.CustomMessage"; #EventArgument: AzSdkRootEventArgument
static [string] $GenerateRunIdentifier = "AzSdk.GenerateRunIdentifier"; #Creates a timestamp and publish, Initialize listeners #EventArgument: AzSdkRootE... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Models/SubscriptionCore/ManagementCertificate.ps1 | ManagementCertificate.ps1 | Set-StrictMode -Version Latest
class ManagementCertificate
{
[string] $CertThumbprint
[string] $SubjectName
[string] $Issuer
[PSObject] $Created
[PSObject] $ExpiryDate
[string] $IsExpired
[PSObject] $Difference
[bool] $Whitelisted
hidden static [ManagementCertificate[]] ListManagementCertifica... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Models/SubscriptionCore/AzureSecurityCenter.ps1 | AzureSecurityCenter.ps1 | Set-StrictMode -Version Latest
class AzureSecurityCenter
{
[PSObject] $Policies
[PSObject] $Alerts
[PSObject] $Tasks
hidden static [PSObject] GetASCPolicies([PSObject] $policyObjects)
{
$pols =@()
if($null -ne $policyObjects -and ($policyObjects | Measure-Object).Count -gt 0)
{
... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Models/SVT/PSCloudService.ps1 | PSCloudService.ps1 | #
# CloudService.ps1
#
Set-StrictMode -Version Latest
class PSCloudService
{
[PSObject] $Name
[PSObject] $Configuration
[PSObject] $DeploymentSlot
[RoleInstance[]] $RoleInstances
[Role[]] $Roles
[PSObject] $VirtualIps
[PSObject] $UpgradeType
[PSObject] $UpgradeDomainCount
[Extension[]] $Extensio... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Models/SVT/SVTResource.ps1 | SVTResource.ps1 | Set-StrictMode -Version Latest
class ResourceTypeMapping
{
[string] $ResourceTypeName
[string] $ResourceType
[string] $JsonFileName
[string] $ClassName
}
class SubscriptionMapping
{
[string] $JsonFileName
[string] $ClassName
}
class SVTResource
{
[string] $ResourceId = "... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Models/SVT/SVTEvent.ps1 | SVTEvent.ps1 | Set-StrictMode -Version Latest
class SVTEvent
{
#First level event
#Command level event
static [string] $CommandStarted = "AzSdk.SVT.Command.Started"; #Initialize listeners #Function execution started
static [string] $CommandCompleted = "AzSdk.SVT.Command.Completed"; #Cleanup listeners #Fu... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Models/SVT/SVTConfig.ps1 | SVTConfig.ps1 | Set-StrictMode -Version Latest
class SVTConfig
{
[string] $FeatureName = ""
[string] $Reference = ""
[bool] $IsManintenanceMode
[ControlItem[]] $Controls = @();
hidden static [SVTConfig] LoadServerConfigFile([string] $fileName, [bool] $useOnlinePolicyStore, [string] $onlineStoreUri, [bool] $... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Models/RemoteReports/ScanResultModels.ps1 | ScanResultModels.ps1 | Set-StrictMode -Version Latest
class ScanInfoBase {
[ScanInfoVersion] $ScanInfoVersion;
[string] $SubscriptionId;
[string] $SubscriptionName;
[ScanSource] $Source;
[string] $ScannerVersion;
[string] $ControlVersion;
ScanInfoBase() {
$this.ScanInfoVersion = [ScanInfoVersi... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Models/ContinuousCompliance/AutomationAccount.ps1 | AutomationAccount.ps1 | Set-StrictMode -Version Latest
enum ScheduleFrequency
{
Hour
Day
}
class AutomationAccount
{
hidden [string] $Name
hidden [string] $ResourceGroup
hidden [string] $Location
hidden [string] $AzureADAppName
hidden [Hashtable] $RGTags
hidden [Hashtable] $AccountTags
}
class UserConfig
{
h... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/Framework/Models/SubscriptionSecurity/SubscriptionRBAC.ps1 | SubscriptionRBAC.ps1 | Set-StrictMode -Version Latest
# Defines data structure for subscription RBAC json
class SubscriptionRBAC
{
[ActiveRBACAccount[]] $ValidActiveAccounts = @();
[RBACAccount[]] $DeprecatedAccounts = @();
}
class RBACAccount
{
#Fields from JSON
[string] $Name = "";
[string] $Description = "";
... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/ContinuousCompliance/ContinuousCompliance.ps1 | ContinuousCompliance.ps1 | Set-StrictMode -Version Latest
function Install-AzSDKContinuousAssurance
{
<#
.SYNOPSIS
This command would help in installing Automation Account in your subscription to setup Continous Assurance feature of AzSDK
.DESCRIPTION
This command will install an Automation Account (Name: AzSDKContinuousAssurance) ... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/SubscriptionSecurity/ARMPolicy.ps1 | ARMPolicy.ps1 | Set-StrictMode -Version Latest
function Set-AzSDKARMPolicies
{
<#
.SYNOPSIS
This command would help in setting up the AzSDK ARM Policies for a Subscription
.DESCRIPTION
This command would help in setting up the AzSDK ARM Policies for a Subscription
.LINK
https://aka.ms/azsdkdocs
#>
[CmdletB... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/SubscriptionSecurity/Alerts.ps1 | Alerts.ps1 | Set-StrictMode -Version Latest
function Set-AzSDKAlerts
{
<#
.SYNOPSIS
This command would help in setting up the Alert rules for the all the critical actions across different Azure Resources under a given Subscription
.DESCRIPTION
This command can be used to setup alert rules for critical resource action... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/SubscriptionSecurity/SubscriptionSecurity.ps1 | SubscriptionSecurity.ps1 | Set-StrictMode -Version Latest
function Set-AzSDKSubscriptionSecurity
{
<#
.SYNOPSIS
This command would help in setting up the all the critical subscription security packages
.DESCRIPTION
This command would help in setting up the all the critical subscription security packages
.LINK
https://aka... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/SubscriptionSecurity/RBAC.ps1 | RBAC.ps1 | Set-StrictMode -Version Latest
function Set-AzSDKSubscriptionRBAC
{
<#
.SYNOPSIS
This command would help in setting up the RBAC rules for a given Subscription
.DESCRIPTION
This command would help in setting up the RBAC rules for a given Subscription
.LINK
https://aka.ms/azsdkdocs
#>
Param(
... |
PowerShellCorpus/PowerShellGallery/AzSDK/2.2.0/SubscriptionSecurity/SecurityCenter.ps1 | SecurityCenter.ps1 | Set-StrictMode -Version Latest
function Set-AzSDKAzureSecurityCenterPolicies
{
<#
.SYNOPSIS
This command would help in setting up the Security Center policies for a Subscription
.DESCRIPTION
This command would help in setting up the Security Center policies for a Subscription
.LINK
https://aka.ms... |
PowerShellCorpus/PowerShellGallery/VMware.PowerCLI/6.5.1.5377412/VMware.PowerCLI.ps1 | VMware.PowerCLI.ps1 | $productName = "PowerCLI"
# Launch text
write-host " Welcome to VMware $productName!"
write-host ""
write-host "Log in to a vCenter Server or ESX host: " -NoNewLine
write-host "Connect-VIServer" -foregroundcolor yellow
write-host "To find out what commands are available, type: " -NoN... |
PowerShellCorpus/PowerShellGallery/xSharePoint/0.12.0.0/Examples/Single Server/SharePoint.ps1 | SharePoint.ps1 | Configuration SharePointServer
{
param (
[Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [PSCredential] $FarmAccount,
[Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [PSCredential] $SPSetupAccount,
[Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [PSCredential] $W... |
PowerShellCorpus/PowerShellGallery/xSharePoint/0.12.0.0/Examples/Small Farm/SharePoint.ps1 | SharePoint.ps1 | Configuration SharePointServer
{
param (
[Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [PSCredential] $FarmAccount,
[Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [PSCredential] $SPSetupAccount,
[Parameter(Mandatory=$true)] [ValidateNotNullorEmpty()] [PSCredential] $W... |
PowerShellCorpus/PowerShellGallery/HappyFinderWrapper/0.0.20/HappyFinderWrapper.tests.ps1 | HappyFinderWrapper.tests.ps1 | #
# This is a PowerShell Unit Test file.
# You need a unit test framework such as Pester to run PowerShell Unit tests.
# You can download Pester from http://go.microsoft.com/fwlink/?LinkID=534084
#
Get-Module HappyFinderWrapper | Remove-Module
# set env variable so Import-Module doesn't fail:
if ([string]::IsNullOrEm... |
PowerShellCorpus/PowerShellGallery/Cloud.Ready.Software.SQL/1.0.0.8/Restore-SQLBackupFile.ps1 | Restore-SQLBackupFile.ps1 | function Restore-SQLBackupFile
{
<#
.Synopsis
Restore a SQL Database to a File
.DESCRIPTION
Working with SQL Backups works much faster than working with NAVDataBackup. Easily working with SQL Backups can termendously make you more effective
.NOTES
No Return value
.PRER... |
PowerShellCorpus/PowerShellGallery/Cloud.Ready.Software.SQL/1.0.0.8/Remove-SQLDatabase.ps1 | Remove-SQLDatabase.ps1 | function Remove-SQLDatabase
{
[CmdletBinding()]
param
(
[Parameter(Mandatory=$false, Position=0)]
[Object]
$DatabaseServer = [net.dns]::GetHostName(),
[Parameter(Mandatory=$false, Position=1)]
[Object]
$DatabaseInstance = '',
[Pa... |
PowerShellCorpus/PowerShellGallery/Cloud.Ready.Software.SQL/1.0.0.8/Invoke-SQL.ps1 | Invoke-SQL.ps1 | <#
.Synopsis
Executes a SQL Statement on the database server
.DESCRIPTION
Will return an object model when records were retrieved
.NOTES
.PREREQUISITES
#>
function Invoke-SQL {
[CmdLetBinding()]
param(
[string] $DatabaseServer = [net.dns]::gethostname(),
[String] $... |
PowerShellCorpus/PowerShellGallery/Cloud.Ready.Software.SQL/1.0.0.8/Drop-SQLDatabaseIfExists.ps1 | Drop-SQLDatabaseIfExists.ps1 | function Drop-SQLDatabaseIfExists {
param ([String]$SQLServer="(local)", $Databasename)
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | Out-Null
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SmoExtended") | Out-Null
[Reflection.Assembly]:... |
PowerShellCorpus/PowerShellGallery/Cloud.Ready.Software.SQL/1.0.0.8/Get-SQLBackupDatabaseName.ps1 | Get-SQLBackupDatabaseName.ps1 | function Get-SQLBackupDatabaseName
{
[cmdletbinding()]
param(
[String] $Backupfile
)
import-module 'sqlps' -DisableNameChecking
$null = get-item $Backupfile -ErrorAction Stop
$srv = new-object ('Microsoft.SqlServer.Management.Smo.Server') ([net.dns]::GetHostName())
$rs... |
PowerShellCorpus/PowerShellGallery/Cloud.Ready.Software.SQL/1.0.0.8/Backup-SQLDatabaseToFile.ps1 | Backup-SQLDatabaseToFile.ps1 | function Backup-SQLDatabaseToFile
{
<#
.Synopsis
Backup a SQL Database to a File
.DESCRIPTION
Working with SQL Backups works much faster than working with NAVDataBackup. Easily working with SQL Backups can termendously make you more effective
.NOTES
Output is a System.IO.Di... |
PowerShellCorpus/PowerShellGallery/Logger/1.0.4/Tests/Logger.Tests.ps1 | Logger.Tests.ps1 | Using module ..\Logger.psm1
Using module ..\Src\Entry\LoggerEntryTrimmed.psm1
Using module ..\Src\Appender\ColoredConsoleAppender.psm1
Using module ..\Src\Appender\AppVeyorAppender.psm1
Using namespace Logger
Set-Variable consoleOutput -Scope Global
Describe 'Logger Tests' {
Mock -ModuleName Colo... |
PowerShellCorpus/PowerShellGallery/Logger/1.0.4/Tests/Coverage.ps1 | Coverage.ps1 | Invoke-ScriptAnalyzer Logger.psm1
Invoke-ScriptAnalyzer Src\*
$sourceFiles = (
@{ Path = ".\Logger.psm1" },
@{ Path = ".\Src\*" },
@{ Path = ".\Src\*\*" }
)
$pesterConfig = @{
path = '.\Tests\Logger.Tests.ps1'
CodeCoverage = $sourceFiles
}
Invoke-Pester @pesterConfig |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Register-ScriptCopPatrol.ps1 | Register-ScriptCopPatrol.ps1 | function Register-ScriptCopPatrol
{
<#
.Synopsis
Registers a ScriptCop patrol, or logical group of rules.
.Description
Registers a ScriptCop patrol, or logical group of rules.
A patrol links command rules and modules rules so that you
can quickly and easily check ... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Get-ScriptCopRule.ps1 | Get-ScriptCopRule.ps1 | function Get-ScriptCopRule
{
<#
.Synopsis
Gets all of the script cop rules.
.Description
Gets all of the script cop rules, and the relative path to the file defining the rule
.Example
Get-ScriptCopRule
.Link
Test-Command
#>
param()
begin... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Test-Module.ps1 | Test-Module.ps1 | function Test-Module
{
<#
.Synopsis
Runs ScriptCop and module test cases
.Description
Runs ScriptCop static analysis on a module, and then runs test cases included with the module.
Tests can be declared in many ways.
ScriptCop will look for a... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Register-ScriptCopFixer.ps1 | Register-ScriptCopFixer.ps1 | function Register-ScriptCopFixer
{
<#
.Synopsis
Registers a new scriptcop fixer
.Description
Registers a new scriptcop fixer.
A fixer (or Repair Rule) will help automatically repair issues when encountered.
.Example
Register-ScriptCopFixer -File .\Re... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Show-ScriptCoverage.ps1 | Show-ScriptCoverage.ps1 | function Show-ScriptCoverage
{
<#
.Synopsis
Shows script coverage for a file or series of files
.Description
This adds a breakpoint to each line of a script file and then runs the files or runs a command
This will output what lines within the file were hit
.Example
... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Unregister-ScriptCopRule.ps1 | Unregister-ScriptCopRule.ps1 | function Unregister-ScriptCopRule
{
<#
.Synopsis
Unregisters a ScriptCop rule.
.Description
Unregisters a ScriptCop rule, prevent it from running
.Example
Unregister-ScriptCopRule -Name Test-DocumentationQuality
.Link
Register-ScriptCopRule
#>
[Cmd... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Test-ScriptCopRule.ps1 | Test-ScriptCopRule.ps1 | function Test-ScriptCopRule
{
[CmdletBinding(DefaultParameterSetName='TestCommandInfo')]
param(
[Parameter(ParameterSetName='TestCommandInfo',Mandatory=$true,ValueFromPipeline=$true)]
[Management.Automation.CommandInfo]
$CommandInfo
)
process {
<#
... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Show-ScriptCop.ps1 | Show-ScriptCop.ps1 | function Show-ScriptCop
{
<#
.Synopsis
Shows a tool for helping you walk thru ScriptCop results
.Description
Shows a tool for helping you walk thru ScriptCop results.
Show-ScriptCop was written using ShowUI. http://ShowUI.Codeplex.Com
.Example
... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Get-ScriptCopPatrol.ps1 | Get-ScriptCopPatrol.ps1 | function Get-ScriptCopPatrol
{
<#
.Synopsis
Gets the currently defined script cop patrols.
.Description
Gets the currently defined script cop patrols.
A Script Cop patrol groups a number of rules to help easily fix a set of issues.
.Example
Get-Script... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Register-ScriptCopRule.ps1 | Register-ScriptCopRule.ps1 | function Register-ScriptCopRule
{
<#
.Synopsis
Registers a new script cop rule
.Description
Registers a new script cop rule.
You can define custom script cop rules and use this command to register them on the fly.
.Link
Unregister-ScriptCopRule
.Example
... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Save-Function.ps1 | Save-Function.ps1 | function Save-Function
{
<#
.Synopsis
Saves one or more functions into automatically named files (i.e. Invoke-MyFunction.ps1)
.Description
Saves functions into automatically named files.
#>
param(
# A script block. When provided an external script,
... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Save-ScriptCopPatrol.ps1 | Save-ScriptCopPatrol.ps1 | None |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Get-ScriptToken.ps1 | Get-ScriptToken.ps1 | function Get-ScriptToken {
<#
.Synopsis
Gets the tokens within a script block or file
.Description
Gets the PowerShell script tokens from a script block or file.
.Example
Get-ScriptToken {
function foo() {
"foo"
}
f... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Get-FunctionFromScript.ps1 | Get-FunctionFromScript.ps1 | function Get-FunctionFromScript {
<#
.Synopsis
Gets the functions declared within a script block or a file
.Description
Gets the functions exactly as they are written within a script or file
.Example
Get-FunctionFromScript {
function foo() {
... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Test-ScriptCopFixer.ps1 | Test-ScriptCopFixer.ps1 | function Test-ScriptCopFixer
{
[CmdletBinding(DefaultParameterSetName='TestCommandInfo')]
param(
[Parameter(ParameterSetName='TestCommandInfo',Mandatory=$true,ValueFromPipeline=$true)]
[Management.Automation.CommandInfo]
$CommandInfo
)
process {
<#
... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Disable-CommandCoverage.ps1 | Disable-CommandCoverage.ps1 | function Disable-CommandCoverage
{
<#
.Synopsis
Disables command coverage for a module
.Description
Disables command coverage tracing for a module
#>
param(
# The name of the module that will be instrumented for command coverage
[Parameter(Mandatory=$true,Position=0... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Unregister-ScriptCopPatrol.ps1 | Unregister-ScriptCopPatrol.ps1 | function Unregister-ScriptCopPatrol
{
<#
.Synopsis
Unregisters a script cop patrol
.Description
Unregisters a script cop patrol (rule group).
.Example
Unregister-ScriptCopPatrol -Name Test-Documentation
.Link
Register-ScriptCopPatrol
#>
param(
... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Unregister-ScriptCopFixer.ps1 | Unregister-ScriptCopFixer.ps1 | function Unregister-ScriptCopFixer
{
<#
.Synopsis
Unregisters a ScriptCop Fixer
.Description
Unregisters a ScriptCop fixer. ScriptCop fixers (or Repair Rules) are commands to help automatically correct encountered issues.
.Example
Unregister-ScriptCopFixer -Name AFixer
... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Enable-CommandCoverage.ps1 | Enable-CommandCoverage.ps1 | function Enable-CommandCoverage
{
<#
.Synopsis
Enables command coverage for a module
.Description
Enables command coverage for a PowerShell module.
Command coverage tracks which functions are called, and which parameters are used.
.Example
Test-Module... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Test-Command.ps1 | Test-Command.ps1 | function Test-Command {
<#
.Synopsis
Test-Command checks commands for consistency.
.Description
Test-Command checks commands for consistency.
Test-Command run a series of static analysis rules on your script, and helps you see if there's anything to improve.
... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Get-ScriptCopFixer.ps1 | Get-ScriptCopFixer.ps1 | function Get-ScriptCopFixer
{
<#
.Synopsis
Gets all of the script cop fixers.
.Description
Gets all of the script cop fixers, and the relative path to the file defining the rule
.Example
Get-ScriptCopFixer
.Link
Repair-Command
#>
param()
... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/ScriptCop.EzFormat.ps1 | ScriptCop.EzFormat.ps1 | $moduleRoot = Get-Module "ScriptCop" | Split-Path
if (-not $moduleRoot) { return }
$formatting = @()
$formatting += Write-FormatView -TypeName ScriptCopError -Property Problem, ItemWithProblem -Wrap -GroupByProperty Rule
$formatting += Write-FormatView -TypeName ScriptCop.Test.Pass.Output -Action {
$writeC... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Get-CommandCoverage.ps1 | Get-CommandCoverage.ps1 | function Get-CommandCoverage
{
<#
.Synopsis
.Description
.Example
Get-CommandCoverage
.Link
Test-Module
.Link
Enable-CommandCoverage
.Link
Disable-CommandCoverage
#>
param(
# The name of the module that will be instrum... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Test-Stress.ps1 | Test-Stress.ps1 | function Test-Stress
{
<#
.Synopsis
Stress testing with PowerShell
.Description
Test-Stress runs any PowerShell script block in parallel, which lets you stress test code.
It returns the results of the script, the start time, end time, and total time to execute
.Exampl... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Repair-Command.ps1 | Repair-Command.ps1 | function Repair-Command
{
<#
.Synopsis
Repair-Command attempts to fix your scripts.
.Description
Repair-Command will use a set of repair scripts to attempt to automatically
resolve an issue uncovered with ScriptCop.
Repair-Command will take all issues thru the pipel... |
PowerShellCorpus/PowerShellGallery/ScriptCop/1.5.2.0/Icicles/ScriptCop.Icicle.ps1 | ScriptCop.Icicle.ps1 | @{
Name = 'ScriptCop'
Screen = {
New-ListBox -On_MouseDoubleClick {
if ($this.SelectedItem) {
$file = $this.SelectedItem.ItemWithProblem.ScriptBlock.File
$ise = [Windows.Window]::GetWindow($this).Resources.ISE
if ($file -and $ise) {
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.