GithubHelp home page GithubHelp logo

cimpsdrive's Introduction

CimPSDrive

The CimPSDrive provider allows easy navigation and discovery of CIM namespaces, including those in WMI. CimPSDrive is a SHiPS based PowerShell provider and is based on CIM cmdlets.

CimPSDrive in Action

Supported Platform

  • PowerShell 5.1 (or later), which is shipped in Windows 10, Windows Server 2016, or WMF 5.1

Dependencies

SHiPS PowerShell module is required.

Usage

  • To start using the functionality of CimPSDrive, import the CimPSDrive module and create a PSDrive

    Import-Module -Name CimPSDrive -Verbose
    New-PSDrive -Name CIM -PSProvider SHiPS -Root CIMPSDrive#CMRoot
  • You can cd into a specific namespace and discover the classes

    # List the classes under cimv2 namespace on local machine
    
    CIM:\localhost\cimv2> dir
    
    # Output will be similar to the following
        Directory: CIM:\localhost\cimv2
    
    Mode Type      Name
    ---- ----      ----
    +    Namespace Applications
    +    Namespace mdm
    +    Namespace power
    +    Namespace Security
    +    Namespace sms
    +    Namespace TerminalServices
    +    Class     CCM_ComputerSystemExtended
    +    Class     CCM_LogicalMemoryConfiguration
    +    Class     CCM_OperatingSystemExtended
    +    Class     CIM_Action
    ...
    ...
  • Using dir or ls, you can find instances of a class

    # Find the details about operating system
    CIM:\localhost\cimv2\Win32_OperatingSystem> dir
    
    # Output will be similar to the following
    SystemDirectory     Organization BuildNumber RegisteredUser SerialNumber            Version    PSComputerName
    ---------------     ------------ ----------- -------------- ------------            -------    --------------
    C:\WINDOWS\system32              16299       Windows User   00329-00000-00003-AA424 10.0.16299 localhost
  • To connect to remote machines, use the Connect-CIM command

    Note: This command only works from within the PSDrive created above

    # Connect to a remote machine
    Connect-CIM -ComputerName remoteMachine
    
    # Now you can see another entry under the PSDrive root
    CIM:\localhost\cimv2\Win32_OperatingSystem> dir /
    
        Directory: CIM:
    
    Mode Type Name
    ---- ---- ----
    +         localhost
    +         remoteMachine

    Now you can navigate the CIM hierarchy on remoteMachine as well.

  • Use Disconnect-CIM command to disconnect from the remote machines

    Note: This command only works from within the PSDrive created above

Installing CimPSDrive

Developing and Contributing

Please follow the PowerShell Contribution Guide for how to contribute.

Legal and Licensing

CimPSDrive is under the MIT license.

cimpsdrive's People

Contributors

hemantmahawar avatar microsoftopensource avatar msftgits avatar murrahjm avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

cimpsdrive's Issues

Invalid namespace error on remote session

When trying to navigate a remote namespace that doesn't also exist on the local host, error "Invalid namespace" is returned. Looking at line 106, it looks like the -cimsession parameter is missing, causing the request to run on the localhost rather than the remote machine.

Add CimClass property/method to CMClass

I'd like to be able to get an instance of the cimclass associated with a CMClass. Get-CimClass works, but when navigating an API that requires a namespace, class name, and CimSession that can be painful (SCCM for example). Having easy access on the item returned by the provider would be a big help with exploration.

Allow defining a PSDrive to child location

In much the same way that the Registry provider allows me to map a PSDrive to a specific registry key, I'd like to be able to map a CIM psdrive like this:

new-psdrive cimv2 -PSProvider SHiPS -Root cim:\localhost\cimv2

As of version 0.3.0 this is not allowed. Although I recognize, this may be a SHiPS issue.

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.