Code Monkey home page Code Monkey logo

dhcppsdrive's Introduction

DhcpPSDrive

The DhcpPSDrive provider allows easy navigation and discovery of a DHCP Server as a drive. It is based on SHiPS provider and uses DHCP Server PowerShell module present locally to pull the information in current user context.

Supported Platform

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

Dependencies

SHiPS PowerShell module is required.

Usage

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

    Import-Module -Name DhcpPSDrive -Verbose
    New-PSDrive -Name DhcpServers -PSProvider SHiPS -Root DhcpPSDrive#DhcpRoot

    By default the DhcpPSDrive will check if the localmachine is a DhcpServer and map it.

  • You will be then able to see the DhcpServer inside the PSDrive. Now navigate it as a PSDrive.

    # Change location to the DhcpServers PSDrive and then list the child items
    PS C:\Windows\system32> Set-Location -Path DHCPServers:/
    
    
    
  • Using dir or ls, you can traverse through the DHCP Server mapped as a Drive.

    PS DHCPServers:\> Get-ChildItem
    
    Name      IPv4Address
    ----      -----------
    dhcp02
    PS DHCPServers:\> cd .\dhcp02\
    PS DHCPServers:\dhcp02> ls
    
        Directory: DHCPServers:\dhcp02
    
    Mode  Name
    ----  ----
    +     IPv4
    +     IPv6
  • To connect to remote machines, use the Connect-DHCPServer command

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

    PS DHCPServers:\> Connect-DHCPServer -ComputerName dhcp01 -Credential (Get-Credential)
    PS DHCPServers:\> ls # Now since the PSDrive caches the connected DHCP servers, this does not reflect the new machine
    
    Name      IPv4Address
    ----      -----------
    dhcp02
    
    PS DHCPServers:\> ls -Force # Pass -Force switch to reflect the new machine connected
    
    Name       IPv4Address
    ----       -----------
    dhcp02
    dhcp01
    
  • Use Disconnect-DhcpServer command to disconnect from the remote DHCP Server

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

Installing DhcpPSDrive

Developing and Contributing

Pull Requests are welcome or raise any issues.

Legal and Licensing

DhcpPSDrive is under the MIT license.

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.