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
# Configure Windows | |
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions -EnableShowFullPathInTitleBar | |
Update-ExecutionPolicy Unrestricted | |
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force | |
Install-Module -Name Get-ChildItemColor,posh-git,terminal-icons -Force | |
## Git | |
winget install -e --accept-source-agreements --silent --accept-package-agreements --id Git.Git |
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 Show-HTML ([string]$HTML) | |
{ | |
[void][System.Reflection.Assembly]::LoadWithPartialName('presentationframework') | |
[xml]$XAML = @' | |
<Window | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | |
Title="PowerShell HTML GUI" WindowStartupLocation="CenterScreen"> | |
<WebBrowser Name="WebBrowser"></WebBrowser> |
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 Start-PoshWebGUI ($ScriptBlock) | |
{ | |
# We create a scriptblock that waits for the server to launch and then opens a web browser control | |
$UserWindow = { | |
# Wait-ServerLaunch will continually repeatedly attempt to get a response from the URL before continuing | |
function Wait-ServerLaunch | |
{ | |
try { |
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-ADdirectReports | |
{ | |
PARAM ($SamAccountName) | |
$AllUsers = @() | |
$Manager = Get-Aduser -identity $SamAccountName -Properties DistinguishedName,CN,co,city,DisplayName,mail | |
$DirectReports = Get-ADUser -Filter {Manager -eq $Manager.DistinguishedName} -Properties manager |
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 Out-JSONView { | |
[cmdletbinding()] | |
Param ( | |
[parameter(ValueFromPipeline)] | |
[psobject]$InbutObject, | |
[int]$Depth = 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
function Get-DirectoryContent { | |
<# | |
.SYNOPSIS | |
Function to get directory content | |
.EXAMPLE | |
Get-DirectoryContent -Path "C:\" -HeaderName "poshserver.net" -RequestURL "http://poshserver.net" -SubfolderName "/" | |
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 new-PowershellWebGUI ($HTMLRaw,$Title,$Runspace) { | |
[xml]$xaml = @" | |
<Window | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
Title="$Title" Height="500" Width="700"> | |
<Grid> | |
<DockPanel> | |
<WebBrowser Name="WebBrowser" DockPanel.Dock="Top" Margin="30"> | |
</WebBrowser> |
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
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>net8.0</TargetFramework> | |
<ImplicitUsings>enable</ImplicitUsings> | |
<Nullable>enable</Nullable> | |
</PropertyGroup> | |
<ItemGroup> |
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
#!/bin/pwsh | |
Install-Module -Name Get-ChildItemColor, oh-my-posh, posh-git, nvm -Force | |
md ~\.config\powershell | |
"Set-Theme -name Darkblood" | Out-File $Profile -Append | |
Install-NodeVersion 8 | |
Install-NodeVersion 10 |
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
$LicenseSKUToNameMapping = @{ | |
'SHAREPOINTENTERPRISE_MIDMARKET' = 'SharePoint Online (Plan 1)' | |
'ESKLESSWOFFPACK_GOV' = 'Microsoft Office 365 (Plan K2) for Government' | |
'AAD_BASIC' = 'Azure Active Directory Basic' | |
'AAD_BASIC_AAD_BASIC' = 'Azure AD Basic - Azure Active Directory Basic' | |
'AAD_BASIC_EDU' = 'Azure Active Directory Basic for EDU' | |
'AAD_EDU' = 'Azure Active Directory for Education' | |
'AAD_PREMIUM' = 'Azure Active Directory Premium P1' | |
'AAD_PREMIUM_AAD_PREMIUM' = 'Azure AD Premium P1 - Azure AD Premium P1' | |
'AAD_PREMIUM |