Launch PowerShell from a .bat file

Solved
Shadow81 -  
brucine Posted messages 24861 Registration date   Status Member Last intervention   -
Hello everyone!
I'm trying to run this .Bat code in PowerShell:
@echo off
cls
set /p IP="Enter an IP="
set /p Incrementation="Enter a Date (YY-MM-DD)="
./mtcli_memo.exe %IP% %Incrementation% >my_file.csv
echo.

So I created this code to run it with PowerShell:
@echo off
Powershell.exe -executionpolicy remotesigned -File C:\Users\Shadow81\Desktop\Code.ps1
pause

However, I get this:
The argument « C:\Users\Shadow81\Desktop\Code.ps1 » for parameter -File does not exist. Specify the path to an existing « .ps1 » file for the argument of the -File parameter.
Windows PowerShell
Copyright (C) Microsoft Corporation. All rights reserved.
Try the new cross-platform PowerShell https://aka.ms/pscore6
Press any key to continue...


And when I launch my .Bat from PowerShell, it opens CMD, while I want it to be launched in PowerShell.

I'm sending you the .bat script hoping I am clear enough in my statements. If not, I apologize ^^' I often have trouble making myself understood.

Thank you in advance for the help you'll provide me ^^

2 answers