Skip to content

Instantly share code, notes, and snippets.

@codywilliamson
codywilliamson / Clear-TeamsCache.ps1
Created September 22, 2023 14:21
Clear Teams' cache & optionally persist settings
function Clear-TeamsCache {
[CmdletBinding(SupportsShouldProcess = $true)]
param (
# Determine if settings should persist after clearing cache
[Parameter()]
[switch]
$PersistSettings
)
begin {
@codywilliamson
codywilliamson / MapParentToChild.cs
Created March 9, 2022 18:23
Map a generic parent object to its child
/// <summary>
/// Maps a parent object to a child object. <br></br>
/// </summary>
/// <typeparam name="T">Generic Type of the Parent Object</typeparam>
/// <typeparam name="U">Generic Type of the Child Object</typeparam>
/// <param name="parent">Parent Object</param>
/// <param name="child">Child Object</param>
/// <returns>U Child object</returns>
public U MapParentToChild<T, U>(T parent, U child)
{