chrislgardner / powershellscripts Goto Github PK
View Code? Open in Web Editor NEWVarious useful scripts I've put together
Various useful scripts I've put together
It would be amazing to have the possibility of the 4 basics
New-FunctionFromType -Type New -Name New-DbaDbAccount -ConfirmImpact Medium -Template C:\temp\dbatools.json -HelpDictionary C:\temp\dbatools.help.definitions.json
Which would output something like this
function New-DbaDbAccount {
<#
.SYNOPSIS
.DESCRIPTION
.PARAMETER SqlInstance
<from template>
.PARAMETER SqlCredential
<from template>
.PARAMETER Name
.PARAMETER DisplayName
.PARAMETER Description
.PARAMETER EmailAddress
.PARAMETER ReplyToAddress
.PARAMETER WhatIf
<from template>
.PARAMETER Confirm
<from template>
.EXAMPLE
PS C:\> DyanamicallyGenerated
#>
[CmdletBinding(SupportsShouldProcess, ConfirmImpact = "Medium")]
param (
[parameter(Mandatory, ValueFromPipeline)]
[DbaInstanceParameter[]]$SqlInstance, # from template?
[PSCredential]$SqlCredential,
[parameter(Mandatory)]
[string]$Name,
[string]$DisplayName,
[string]$Description,
[string]$EmailAddress,
[string]$ReplyToAddress,
[switch]$EnableException
)
process {
if ($Pscmdlet.ShouldProcess("templated words")) {
try {
$account = New-Object Microsoft.SqlServer.Management.SMO.Mail.MailAccount $placeholder, $Name
$account.DisplayName = $DisplayName
$account.Description = $Description
$account.EmailAddress = $EmailAddress
$account.ReplyToAddress = $ReplyToAddress
$account.Create()
} catch {
<ExceptionAction from template>
}
}
}
}
New-FunctionFromType -Type All -Name New-DbaDbAccount -ConfirmImpact Medium -Template C:\temp\dbatools.json -HelpDictionary C:\temp\dbatools.help.definitions.json
Remove and Set would include [<classname>]$InputObject
then in the body foreach ($thing in $InputObject)
Cool tools you have here ๐ Just getting started with PowerShell (I didn't know you could make a UI with it)
I adjusted some things so that I can use the GUI
Get-Folders
function has to be declared before the variables (Not sure if that is just a new PowerShell version thing)$FolderLocation
to = Split-Path $MyInvocation.MyCommand.Path -Parent
so scripts can live somewhere convenientA declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.