Skip to content

Instantly share code, notes, and snippets.

View AshFlaw's full-sized avatar

AshFlaw

  • The Full Circle
View GitHub Profile
@AshFlaw
AshFlaw / ChocoInstall.ps1
Last active March 20, 2024 19:59
Install Chocolatey with PowerShell and enable global automatic install confirmations.
Set-ExecutionPolicy Unrestricted
# Install Chocolatey
Invoke-WebRequest https://chocolatey.org/install.ps1 -UseBasicParsing | Invoke-Expression
# Enable Global confirmation (auto accept any prompts)
choco feature enable -n=allowGlobalConfirmation
@AshFlaw
AshFlaw / Update-CSOMFolderMetadata.ps1
Created June 19, 2023 08:58
SharePoint Online: Update folder metadata in document library
function Update-CSOMFolderMetadata {
param (
[Parameter(Mandatory=$True)]
$SiteURL,
[Parameter(Mandatory=$True)]
$FileServerRelativeUrl,
$CreatedBy,
$ModifiedBy,
$CreatedOn,
$ModifiedOn,
@AshFlaw
AshFlaw / Update-CSOMFileMetadata.ps1
Last active June 19, 2023 08:56
SharePoint Online: Update file metadata in document library
function Update-CSOMFileMetadata {
param (
[Parameter(Mandatory=$True)]
$SiteURL,
[Parameter(Mandatory=$True)]
$FileServerRelativeUrl,
$CreatedBy,
$ModifiedBy,
$CreatedOn,
$ModifiedOn,
@AshFlaw
AshFlaw / Get-CSOMDocumentLibraryInventory.ps1
Last active June 19, 2023 08:55
SharePoint Online: Get an inventory of files and folders from a document library
function Get-CSOMDocumentLibraryInventory {
param (
[Parameter(Mandatory=$True)]
[string]$SiteURL,
[Parameter(Mandatory=$True)]
[string]$LibraryName,
[int]$BatchSize,
[Parameter(Mandatory=$True)]
[System.Management.Automation.PSCredential]
$Credential
@font-face {
font-family: KaTeX_AMS;
src: url(/static/fonts/KaTeX_AMS-Regular.38a68f7.woff2) format("woff2"), url(/static/fonts/KaTeX_AMS-Regular.7d307e8.woff) format("woff"), url(/static/fonts/KaTeX_AMS-Regular.2dbe16b.ttf) format("truetype");
font-weight: 400;
font-style: normal
}
@font-face {
font-family: KaTeX_Caligraphic;
src: url(/static/fonts/KaTeX_Caligraphic-Bold.342b296.woff2) format("woff2"), url(/static/fonts/KaTeX_Caligraphic-Bold.9634168.woff) format("woff"), url(/static/fonts/KaTeX_Caligraphic-Bold.33d2688.ttf) format("truetype");
@AshFlaw
AshFlaw / Set-StrongCryptoDotNet4.ps1
Created July 6, 2020 07:12
Permanently set .NET and PowerShell to use TLS1.2
# set strong cryptography on 64 bit .Net Framework (version 4 and above)
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Wow6432Node\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord
# set strong cryptography on 32 bit .Net Framework (version 4 and above)
Set-ItemProperty -Path 'HKLM:\SOFTWARE\Microsoft\.NetFramework\v4.0.30319' -Name 'SchUseStrongCrypto' -Value '1' -Type DWord
@AshFlaw
AshFlaw / styles_custom_v2.css
Last active February 10, 2020 10:34
PRTG login and application page customization to remove news feed, footer, logo, lower message text, lost password and download client links.
/*
// You can use this file to modify the appearance of the PRTG web interface
// as described in https://kb.paessler.com/en/topic/33
//
// Please note that you are using an unsupported and deprecated feature.
// Your changes will be broken or removed with future PRTG updates.
//
// If you modify this file, PLEASE LET US KNOW what you're changing and why!
// Just drop an email to support@paessler.com and help us understand your
// needs. Thank you!
@AshFlaw
AshFlaw / Get-FolderSize.ps1
Created October 7, 2019 11:03
Get size of folder
Function Get-FolderSize {
[cmdletbinding()]
param
(
[Parameter(Mandatory = $false)]
[Alias('Path')]
[String[]]
$BasePath = 'C:\',
[Parameter(Mandatory = $false)]
[Alias('User')]
@AshFlaw
AshFlaw / Set-SQLMSXEncryptionChannelOff.ps1
Created March 5, 2019 19:33
Function to disable SQL Agent MSX Encryption
Function Set-SQLMSXEncryptionChannelOff
{
$Path = "HKLM:\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL13.SE\SQLServerAgent"
$Name = "MsxEncryptChannelOptions"
$DefaultValue = "2"
$NewValue = "0"
$ComputerName = $Env:COMPUTERNAME
$Item = (Get-ItemProperty $Path -Name $Name).$Name
if($Item -eq $DefaultValue)
{
@AshFlaw
AshFlaw / Register-WSUSOnlineAndInstallUpdates.ps1
Created February 24, 2019 16:03
Register MS Online updates provider to WU and install updates.
Add-WUServiceManager -ServiceID 7971f918-a847-4430-9279-4a52d1efe18d
Get-WUInstall –MicrosoftUpdate –AcceptAll –AutoReboot