This file contains hidden or 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
| # Get all Modules, Functions, Alias' ...etc available on your computer | |
| Get-Command -all | |
| # Search for all cmdlets that contain Service in the noun portion. | |
| Get-command –noun Service | |
| # Search for all cmdlets that contain Stop in the verb portion | |
| Get-Command -Verb Stop | |
| # You can also use the * character as a wildcard |
This file contains hidden or 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
| # You must have Chocolately installed first | |
| # Usage example | |
| # Install-MySoftware -Computers dc1,dc2,svr12,svr16 -Packages 'powershell.portable','microsoft-edge','microsoft-windows-terminal' | |
| Function Install-MySoftware { | |
| [CmdletBinding()] | |
| Param( | |
| [Parameter()] | |
| [string[]]$Computers, |
This file contains hidden or 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
| # Install Chocolatey | |
| Invoke-Command -ComputerName DC -ScriptBlock { | |
| Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) | |
| choco feature enable -y allowGlobalConfirmation | |
| } |
This file contains hidden or 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-Inventory { | |
| <# | |
| .SYNOPSIS | |
| Gets a variety of computer information remotely and exports it to | |
| a CSV file. | |
| .PARAMETER Computers | |
| Specifies the Computer names of devices to query | |
| .INPUTS |
This file contains hidden or 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-LocalAdmins { | |
| <# | |
| .SYNOPSIS | |
| Gets the members of the local administrators of the computer | |
| and outputs the result to a CSV file. | |
| .PARAMETER Computers | |
| Specifies the Computer names of devices to query | |
| .INPUTS | |
| System.String. Get-LocalAdmins can accept a string value to | |
| determine the Computers parameter. |
This file contains hidden or 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 Format-MerchReports { | |
| <# | |
| .SYNOPSIS | |
| Reformats and combines Merch by Amazon sales reports | |
| .DESCRIPTION | |
| 1. Deletes the first 13 rows of each CSV in $csvPath | |
| 2. Combines the data from all the files | |
| 3. Adds column headers defined in $finalHeader | |
| 4. Outputs the file to $csvPath as formatted-Merchreports.csv |
This file contains hidden or 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
| { | |
| "$schema": "https://schema.management.azure.com/schemas/2015-01-01/deploymentTemplate.json#", | |
| "contentVersion": "1.0.0.0", | |
| "parameters": { | |
| "adminUsername": { | |
| "type": "string", | |
| "metadata": { | |
| "description": "The name of the administrator account of the new VM and domain" | |
| } | |
| }, |
This file contains hidden or 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 ConvertTo-PDF { | |
| <# | |
| .DESCRIPTION | |
| Convert 1 or many files to PDFs | |
| .PARAMETER filePath | |
| -filePath: The path to the folder that contains all your text files | |
| .PARAMETER dllPath | |
| -dllPath: The Path to the iTextSharp.DLL file |
This file contains hidden or 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
| # Run on the target node | |
| [DSCLocalConfigurationManager()] | |
| Configuration LCMConfig { | |
| Node SVR { | |
| Settings { | |
| ConfigurationMode = 'ApplyAndAutoCorrect' | |
| RefreshMode = 'Pull' | |
| } | |
| ConfigurationRepositoryWeb PullServer { |
This file contains hidden or 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
| # 5. Create the client MOFs | |
| # https://github.com/PowerShell/AuditPolicyDsc | |
| Configuration AuditPolicyCsv { | |
| param( | |
| [String] $NodeName = 'SVR' | |
| ) | |
| Import-DscResource -ModuleName AuditPolicyDsc |