How to call Split-File and Join-File operation thru windows batch file

DHAVAL J TRIVEDI 41 Reputation points
2022-02-04T11:13:12.33+00:00

Hello Team,

I have found that with Split-File and Join-File, I am able to split and join the file. My requirement is to now run the Split-File and Join-File command thru Windows Batch file.

My batch file contains as below. But it is not successfully running. Could you help me to write the batch file which will first create the Split-File function and then run the Split-File command.

Powershell ./Split-File.ps1
powershell Split-File -Path "C:\Projects\XYZ\Google.zip" -PartSizeBytes 15MB

Thank you in advance
Dhaval.

Windows for business | Windows Server | User experience | PowerShell
{count} votes

Accepted answer
  1. Andreas Baumgarten 123.4K Reputation points MVP Volunteer Moderator
    2022-02-04T11:19:46.303+00:00

    Hi @DHAVAL J TRIVEDI ,

    does this work?

    PowerShell -Command "& {.\Split-File.ps1; Split-File -Path "C:\Projects\XYZ\Google.zip" -PartSizeBytes 15MB}"  
    

    ----------

    (If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

    Regards
    Andreas Baumgarten

    0 comments No comments

0 additional answers

Sort by: Most helpful

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.