Skip to content
 
 

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 

Repository files navigation

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.

About

A Documentation for my module PS2BAT, it converts Powershell Scripts to Batchfile ones.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages