Git Product home page Git Product logo

powershellscripts's People

Contributors

chrislgardner avatar iisresetme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

Forkers

iisresetme

powershellscripts's Issues

Request: Get, Set, New and Remove for Class

It would be amazing to have the possibility of the 4 basics

  • Get
  • Set
  • New
  • Remove

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)

Update for ScriptGUI

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

  • The Get-Folders function has to be declared before the variables (Not sure if that is just a new PowerShell version thing)
  • Changed $FolderLocation to = Split-Path $MyInvocation.MyCommand.Path -Parent so scripts can live somewhere convenient

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.