Skip to content

Instantly share code, notes, and snippets.

View paschott's full-sized avatar

Peter Schott paschott

View GitHub Profile
cls
get-date
Import-Module AssistDeploy -Force
$thisSsisPublishFilePath = "C:\Users\SQLTraining\Documents\bob.json"
$thisIspacToDeploy = "C:\Users\SQLTraining\Downloads\sql-server-samples-master\sql-server-samples-master\samples\databases\wide-world-importers\wwi-ssis\wwi-ssis\bin\Development\Daily ETL.ispac"
$svr = "Server=.\hh;Integrated Security=True"
$myJsonPublishProfile = Import-Json -jsonPath $thisSsisPublishFilePath -ispacPath $thisIspacToDeploy -localVariables
$ssisdb = Connect-SsisdbSql -sqlConnectionString $svr
Publish-SsisFolder -jsonPsCustomObject $myJsonPublishProfile -sqlConnection $ssisdb
Publish-SsisEnvironment -jsonPsCustomObject $myJsonPublishProfile -sqlConnection $ssisdb
@jdhitsolutions
jdhitsolutions / Get-AVStatus.ps1
Last active February 17, 2024 23:33
This PowerShell function uses WMI via the Get-CimInstance command to query the state of installed anti-virus products.
#requires -version 5.1
Function Get-AVStatus {
<#
.Synopsis
Get anti-virus product information.
.Description
This command uses WMI via the Get-CimInstance command to query the state of installed anti-virus products. The default behavior is to only display enabled products, unless you use -All. You can query by computername or existing CIMSessions.
.Example
@wpsmith
wpsmith / Set-SQLAutoGrouth.ps1
Created May 19, 2015 12:32
PowerShell: Set AutoGrowth for SQL Server cycling through the individual filegroups as well as excluding system databases.
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SqlServer.SMO") | out-null
$server = New-Object ("Microsoft.SqlServer.Management.Smo.Server") "localhost"
$databases = $server.Databases;
foreach ($db in $databases ) {
#Set Log File growth
if ($db.Status -eq 'Normal' -and -$db.IsSystemObject -eq $false) {
$l = $db.LogFiles[0]
$l.GrowthType = "KB"
$l.Growth = "51200"
$l.Alter();