Posts

Showing posts from 2022

Powershell to Create Custom theme for Modern SharePoint Pages

I used the theming designer to get me started with the theme color set. https://fabricweb.z5.web.core.windows.net/pr-deploy-site/refs/heads/7.0/theming-designer/index.html I then changed a few colors directly to more match the specific cooperate color codes. Easy as you please. #Set Admin Center URL $AdminCenterURL = "https://XXXXXXXXXXXXXXXXXXXXX.sharepoint.com/" #Connect to Admin Center Connect-PnPOnline -Url $AdminCenterURL -Interactive #Define the color palette $ThemePalette = @ { "themePrimary" = "#313842" ; "themeLighterAlt" = "#f5f6f7" ; "themeLighter" = "#d7dbe1" ; "themeLight" = "#b7bdc6" ; "themeTertiary" = "#e26653" ; "themeSecondary" = "#de543e" ; "themeDarkAlt" = "#2c333c" ; "themeDark" = "#252b32" ; "themeDarker" = "#1b1f25...

PowerShell PGP Decryption

 In this case, I am taking an PGP encrypted file, decrypting it, creating an archived version of the file, and then moving it to its new location Gunna be honest, this code is SUPER temperamental. Sometimes it doesn't want the credentials. Some times it won't run it with out it. Use at your own risk. It works, it just...is a diva as far as scripts go. #Date Variables $CurrentDate = Get-Date $Date_Append = Get-Date -Format "yyyyMMdd" $DatetoDelete = $CurrentDate .AddDays(-182) ##Declared locations, separated for simi reusability $Key_Location = "YOUR-KEY-HERE" $Source_Location = 'WHERE-IS-THE-FILE.CSV' $Destination_Location = 'WHERE-IS-IT-GOING' $CopySource_Location = $Destination_Location + "FILENAME" $Archive_Location = "ARCIVE-GO-HERE\" $Archive_FilePath = $Archive_Location + "MY-fILENAME" + $DateF_Append + ".csv" $Archive_SourceFilePath = $Archive_Location + "MYFILE.CSV...

Posting Code Stubs onto blogger.

Image
 This is kind of an easy one, but since I found it to be a problem while I was trying to upload my last code block....you know,  I might as well post it here as well. http://hilite.me/ Nice. I love it when the tool you need just already exists, you needed to know where.

Automated Removal of Old Blob Storage with Powershell.

This was a request/refactoring of code from a DBA I know, and making it work in our environment. Pretty simple, but still required a bit of tinkering. Ensure the module is installed, and set the alias just incase. (For reusability) Set the Containers and the Accounts. Set the Time Context. Minor note, the code I was working from was "like blob" but the script found no hits. Looking at the directory manually I saw everything was "blockblob" so that is what we aimed the script to remove. Again this is pretty straightforward, Just took some time to get it just so. #Ensure Azure Installed if ( Get-Module -ListAvailable -Name AZ) { Write-Host "Azure Module Installed" } else { Write-Host "Installing Azure module" Install-Module Install-Module Az -Force -AllowClobber Import-Module Az } Enable-AzureRmAlias Connect-AzAccount $container = "YOUR_CONTAINER" $StorageAccountName = "YOUR_ACCOUNT_NAME" $bakH...