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
using module .\SevOne.psm1 | |
[SevOne.device] | |
[SevOne.something] |
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
## TODO: Make this a ReadMe. | |
## In the meantime, this is a series of lines meant to be typed into a PowerShell host as a demo: | |
# dull prompt | |
ipmo Powerline; Set-PowerlinePrompt | |
$function:prompt | |
# That's a little prettier ... | |
pushd .\Documents\WindowsPowerShell\ | |
# Oh, I want to see the location stack size | |
Get-Location -Stack |
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(DefaultParameterSetName='NameParameterSet', SupportsShouldProcess=$true, ConfirmImpact='Medium', HelpUri='https://go.microsoft.com/fwlink/?LinkID=398573')] | |
param( | |
[Parameter(ParameterSetName='NameParameterSet', Mandatory=$true, Position=0, ValueFromPipelineByPropertyName=$true)] | |
[ValidateNotNullOrEmpty()] | |
[string[]] | |
${Name}, | |
[Parameter(ParameterSetName='InputObject', Mandatory=$true, Position=0, ValueFromPipeline=$true, ValueFromPipelineByPropertyName=$true)] | |
[ValidateNotNull()] | |
[psobject[]] |
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
"365-LicenseObject": { | |
"prefix": "O365-LicenseObject", | |
"body": [ | |
"\\$enabledplans = 'SHAREPOINTWAC','YAMMER_ENTERPRISE','SHAREPOINTSTANDARD'", | |
"", | |
"#Get the licensesku and create the Disabled ServicePlans object", | |
"\\$licensesku = Get-AzureADSubscribedSku | Where-Object {\\$_.SkuPartNumber -eq '${License}'} ", | |
"\r", | |
"#Loop through all the individual plans and disable all plans except the one in \\$enabledplans", | |
"\\$disabledplans = \\$licensesku.ServicePlans | ForEach-Object -Process { ", |
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
# Import Mandatory Modules | |
Import-Module -Name Toolbox | |
Import-Module posh-git | |
# function declarations | |
function Open-Here { explorer $pwd } | |
function Set-SupportPath { Set-Location C:\support } | |
function Set-DocsPath { Set-Location $env:OneDrive\documents } | |
function Set-HomePath { Set-Location $home } | |
function Set-GitPath { Set-Location C:\support\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
Set-Content -Encoding UTF8 -Path C:\github\dbatools\allcommands.ps1 -Value "### DO NOT EDIT THIS FILE DIRECTLY ###" | |
Get-ChildItem -Path "C:\github\dbatools\functions\*.ps1" -Recurse | Get-Content | Add-Content C:\github\dbatools\allcommands.ps1 | |
Get-ChildItem -Path "C:\github\dbatools\internal\functions\*.ps1" -Recurse | Get-Content | Add-Content C:\github\dbatools\allcommands.ps1 | |
Remove-Item -Recurse C:\gallery -Force | |
mkdir C:\gallery\dbatools | |
robocopy c:\github\dbatools C:\gallery\dbatools /S /XF *.psproj* *.git* *.yml /XD .git .github Tests .vscode | Out-String | Out-Null | |
Remove-Item -Recurse C:\gallery\dbatools\bin\build -ErrorAction Ignore | |
Remove-Item -Recurse C:\gallery\dbatools\bin\projects -ErrorAction Ignore |
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
#region Custom Function Definitions | |
Function Test-Administrator { | |
$CurrentUser = [Security.Principal.WindowsIdentity]::GetCurrent() | |
$AdministratorRole = [Security.Principal.WindowsBuiltInRole] "Administrator" | |
([Security.Principal.WindowsPrincipal]$CurrentUser).IsInRole($AdministratorRole) | |
} | |
#endregion | |
#region Prompt Prep | |
# Set ENV for elevated status |