Git Product home page Git Product logo

ps2bat's Introduction

PS2BAT Module Documentation

  • Powershell Into Batchfile!

Overview

The PS2BAT module provides a cmdlet called Convert-PSToBAT, allowing users to convert PowerShell scripts (*.ps1 files) into batch files (*.bat files). This can be useful for scenarios where running PowerShell scripts might be restricted, and a batch file serves as a workaround.

Installing Module:

Install-Module -Name PS2BAT

Make sure to run Powershell as administrator.

If you don't want to install the module, you can try the direct import method (See below).

Usage

Standard Module Import:

Import-Module -Name PS2BAT -Force
Convert-PSToBAT -Path "POWERSHELL_FILE_PATH"
  • -Path: Specifies the path to the PowerShell script file you want to convert.

Alternative Import Method (IF PROBLEMS):

Only for Windows PowerShell. Not for PowerShell 7.

Import-Module -Name 'C:\Program Files\WindowsPowerShell\Modules\PS2BAT\1.0.0\PS2BAT.psm1' -Force 
Convert-PSToBAT -Path "PATH_TO_PS1_FILE"

Direct Import Method:

  • Works with all versions of Powershell
  • No need to install the module
  1. Make sure your Execution Policy is compatible.
  2. Open PowerShell in the folder of the module.
  3. Then execute this:
Import-Module -Name .\PS2BAT.psm1 
Convert-PSToBAT -Path "PATH_TO_PS1_FILE"

Users can use alternative import methods if they encounter issues with the standard module import. Make sure to provide the correct path to the PS2BAT.psm1 file and the PowerShell script file you want to convert.

ps2bat's People

Contributors

evilbytecode avatar extremepro11299 avatar

Stargazers

 avatar  avatar 5541502D504C543A584F524F58 avatar bytepulze avatar crusher avatar  avatar aubrey avatar Netwalker avatar KarbitsCode avatar Mystific avatar  avatar  avatar

Watchers

 avatar

Forkers

extremepro11299

ps2bat's Issues

Convert-PSToBAT cmdlet not working

I did use the newest Powershell 7 though, which might not be compatible with this module. However, since this is Powershell 7 and not Windows Powershell, the modules folder might be in a different location. I haven't tried that yet though.
image

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.