Skip to content

Instantly share code, notes, and snippets.

View shurick81's full-sized avatar

Aleksandr Sapozhkov shurick81

View GitHub Profile
@phillipharding
phillipharding / Set an PropertyBag property as Indexable (Queryable via Search) using CSOM + Powershell.ps1
Last active October 20, 2015 08:51
Set a PropertyBag property as Indexable (Queryable via Search) using CSOM + Powershell
function Set-PropertyBag {
param (
[string]$PropertyName,
[string]$PropertyValue = $null,
[bool]$Indexable = $false,
[Microsoft.SharePoint.Client.Web]$Web,
[Microsoft.SharePoint.Client.ClientContext]$ClientContext
)
process {
$indexedPropertyBagKey = "vti_indexedpropertykeys"
@develohpanda
develohpanda / delete-sql.ps1
Last active July 2, 2024 19:05
Drop SQL database from Powershell
function Delete-SqlDatabase($serverName, $databaseName) {
Import-Module SQLPS
$server = New-Object Microsoft.SqlServer.Management.Smo.Server($serverName)
$db = $server.databases[$databaseName]
if ($db) {
$server.KillAllprocesses($databaseName)
$db.Drop()
}
}