This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$shapeName = 'Rounded Rectangle 664' | |
Add-type -AssemblyName office | |
$Application = New-Object -ComObject powerpoint.application | |
$application.visible = [Microsoft.Office.Core.MsoTriState]::msoTrue | |
$powerpointFile = "D:\PoSHCode\GitLocal\PowerPoint\RandomLogoff3.pptx" | |
$presentation = $application.Presentations.open($powerpointFile) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$Path = 'c:\myicon.png' | |
$Bytes = get-content $Path -AsByteStream -Raw | |
$inputFromBase64conv = [convert]::ToBase64String($Bytes) | |
$out = [System.Convert]::FromBase64String($inputFromBase64conv) | |
Write-Output $out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$stopwatch = [system.diagnostics.stopwatch]::StartNew() | |
while ($true) { $stopwatch.Elapsed.ToString().SubString(0, 8); Start-Sleep 1; Clear-Host} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function Get-WpmRestApp { | |
[CmdletBinding()] | |
Param ( | |
[Parameter( | |
Position = 0, | |
ValuefromPipelineByPropertyName = $true, | |
ValuefromPipeline = $true, | |
Mandatory = $true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$cmdletName -cmatch "^(?:[A-Z]{1,3}(?:[a-z0-9_])+)+[A-Z]{0,2}-(?:[A-Z]{1,3}(?:[a-z0-9_])+)+[A-Z]{0,2}$" | |
$parameterName -cmatch '^(?:[A-Z]{1,3}(?:[a-z0-9_])+)+[A-Z]{0,2}$' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
If the email is in the format below | |
Jim Moyle <[email protected]> | |
it will be cleaned up by the replace regex to this one: | |
[email protected] | |
#> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$diskCompactionEvents = Get-WinEvent -FilterHashtable @{ | |
LogName = 'Microsoft-FSLogix-Apps/Operational' | |
ID = 57 | |
} | |
foreach ($event in $diskCompactionEvents) { | |
$out = [PSCustomObject]@{ | |
ImagePath = $event.Properties[0].Value | |
'TimeTaken(ms)' = $event.Properties[7].Value | |
'InitialSize(MB)' = $event.Properties[4].Value |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Requires -RunAsAdministrator | |
#Requires -Modules 'Hyper-V' | |
# Once this has been run once, you will be able to use the Invokle-ShrinkFslDisk tool to get max shrink from all disks, without having to copy. | |
# Required Services = 'defragsvc', 'vds', 'smphost' ! This script will fail if you don't have these services running ! | |
# Change the source and target path as needed | |
# Run from a VM with FSLogix installed | |
# Does not need to be run on a FileServer | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[CmdletBinding()] | |
Param ( | |
[Parameter( | |
ValuefromPipelineByPropertyName = $true, | |
ValuefromPipeline = $true, | |
Mandatory = $true | |
)] | |
[System.String]$vmSKU, |