Skip to content

Instantly share code, notes, and snippets.

@mnightingale
mnightingale / FixWhitespace.ps1
Last active March 22, 2024 14:49
Remove leading and trailing whitespace from file and directories
param(
[Parameter(Mandatory)]
[string]$path,
[switch]$dry
)
filter Rename-Whitespace {
$desired = $_.Name.Trim()
if ($_.Name -ne $desired) {
Write-Output $_.FullName
@mnightingale
mnightingale / import_eml_to_office_365.ps1
Created May 3, 2021 18:33
Import *.eml format files into Office 365 Personal using the Exchange Web Service (EWS)
###################################################################################################
# Author: Michael Nightingale
#
# This (my first PowerShell) script can be used to import .eml files into an Office 365 (Personal)
# account (some minor changes could be made to use it on an organisation/business plan)
# $importFromFolder will be traversed recursively and the folder structure recreated on O365.
#
# IMPORTANT: Files are renamed as they are imported imported, because of long file name problems
# I chose to just SHA256 the existing name and suffix .done, I choose to rename so that the
# script could be restarted if an error occurs.
struct CalendarPageView<Page: View>: View {
private let options: PagingOptions
private let content: (CalendarItem) -> Page
/// Initialize a new `CalendarPageView`.
///
/// - Parameters:
/// - options: The configuration parameters we want to customize.
/// - content: A callback that returns the `View` for each item.
init(