GithubHelp home page GithubHelp logo

exactmike / oneshell Goto Github PK

View Code? Open in Web Editor NEW
12.0 12.0 3.0 955 KB

OneShell is a PowerShell Connection Manager for Office 365, Azure, and other Cloud services that support PowerShell connectivity

License: MIT License

PowerShell 100.00%
active-directory administration automation azure azure-active-directory exchange exchange-online lotus-notes microsoft365 office365 powershell powershell-remoting scheduled-tasks skype-for-business

oneshell's Issues

The psm1 uses powershell instead of pwsh

Just opening an issue for my pull request #12 , pwsh is the new name for powershell core and the name of the supported production binary on *nix systems. The new name should be embraced to make sure the module is not broken going forward.

Nice presentation at the summit BTW.

Implement ManagedConnections in OneShell

OneShell is a connection/session manager for Systems/Services that can be accessed via PowerShell. It uses Profiles to implement this functionality, managing the system/service definitions, endpoints, credentials, etc. Connections can be made by OneShell via PowerShell Remoting (eg. Exchange Online, Skype Online, etc.) or via 'Local Connect' (eg. AzureAD via Import-Module and Connect-AzureAD) or a combination of these 2 techniques.

Currently, OneShell's connection/session management is limited to the following features:

  • auto connection to a user defined set of systems
  • on demand connection to user defined system(s)
  • auto grouping of sessions into session management groups for one to many management (eg. Invoke-Command -Session $SessionGroup).
  • on demand testing of connection
  • re-connection to one or more existing connections if needed (if testing shows the connection has failed)

The goal of this issue is to define implementation of these additional features:

  • multiple connections to the same system (for parallel operations, background jobs, etc.)
  • 'clean' disconnection of an existing connection where possible (depending on service type support)
  • tracking of connections to service types to avoid or warn about potential conflicts (for example, connection operations that would clobber existing commands in the local PowerShell session)
  • get all OneShell connections
  • Improved session management groups
  • Improved/Robust support for Prefixing with 'LocalConnect' systems.
    This is needed to manage imports of modules with command prefixing if the user requests it in their profile configuration or connect-oneshellsystem parameters. And to handle disconnection if the same module was previously imported for a different system.

Implementation Proposal Summary

Implementation will require new functions and new connection tracking mechanism(s). The proposed solution would include the following (more detail to follow below):

  • Module variable ManagedConnections array to track each Connection
  • New function Remove-OneShellSystemPSSession (would remove an imported session from being imported but not the session itself)
  • New function Get-OneShellConnection (or Get-OneShellSystemConnection)
  • Update function Import-OneShellSystemPSSession to update ManagedConnections entry(ies)
  • New function Disconnect-OneShellSystem to manage the 'cleanes' disconnection possible for a given ServiceType and connection type (PS Remoting or LocalConnect).

Implementation Proposal Detail

$Script:ManagedConnections

  • Array of PSCustomObject
  • Attributes
    • ManagedConnectionID (Incremented Int)
    • Identity (of the System from the OrgProfile)
    • Name (of the system from the OrgProfile)
    • OrgProfileIdentity
    • OrgProfileName
    • UserProfileIdentity
    • UserProfileName
    • PSSessionName (null for LocalConnect)
    • PSSessionID (null for LocalConnect)
    • Imported (bool for whether the PSSession is imported locally or import-module was used)
    • ImportedModuleName (the auto/random module name PS assigns to imported session modules)
    • ConnectionType (LocalConnect|PSRemoting)
    • PrefixApplied (at import - might be null)
    • EndpointIdentity (might be null)
    • First/Default Connection?

Update function Import-OneShellSystemPSSession

It needs to update a ManagedConnections entry attributes ImportedModuleName, Imported, Prefix

New function Remove-OneShellSystemPSSession

It needs to remove an imported session/session module but leave the session running for later import or disconnection. In other words, it's not doing the job of Remove-PSSession. Instead, it is reversing Import-PSSession (or in OneShell's case Import-OneShellSystemPSSession).

New function Get-OneShellConnection

Parameter Sets

  • all
  • byIdentity
  • byServiceType
  • other?

New function Disconnect-OneShellSystem

Parameter Sets

  • All
  • Identity (all connections for specified system(s) or scoped to ConnectionID)
  • ServiceType (all connections for a servicetype or scoped to ConnectionID)
  • ConnectionID (specific connection(s))

Description

branches depending on ConnectionType (LocalConnect or PSremoting)

  • PSRemoting steps
    • If imported, remove imported module
    • If disconnect command is defined in servicetype, run disconnect command in PSSession
    • Remove PSSession from local session and session management group(s)
  • LocalConnect steps
    • If disconnect command is defined in servicetype, run disconnect command locally
    • if not, optionally warn user (if warning is defined in servicetype). This is because certain connections can persist even through module removal (see MSOnline module for an example).

Autocompleters for parameters for all the above functions

  • for Identity to limit ConnectionIDs
  • for ConnectionID to limit Identities
  • for ServiceType to limit ConnectionIDs and Identities

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.