Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6978265
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:43:58+00:00 2026-05-27T17:43:58+00:00

I have pulled the Bash script from here , which checks the AVI file

  • 0

I have pulled the Bash script from here, which checks the AVI file for bad frames using ffmpeg and cygwin extension. I am able to execute the code in Mingw. I put ffmpeg.exe (ren ffmpeg), cygwin1.dll & cygz.dll in Mingw’s bin dir (/c/mingw/bin/). Now, I am looking to port this bash code to PowerShell. Can anyone shed some PowerShell light on this one?

Script: (path: /c/mygw/bin/AviConvert)

#!/bin/bash

FFMPEG="ffmpeg"
LIST=`find | grep \.avi$`

for i in $LIST; do
    OUTP="$i.txt"
    OUTP_OK="$i.txt.ok"
    TMP_OUTP="$i.tmp"
    if [ -f "$OUTP" -o -f "$OUTP_OK" ] ; then
    echo Skipping "$i"
    else
    echo Checking "$i"...
    RESULT="bad"
    ffmpeg -v 5 -i "$i" -f null - 2> "$TMP_OUTP" && \
        mv "$TMP_OUTP" "$OUTP" && \
        RESULT=`grep -v "\(frame\)\|\(Press\)" "$OUTP" | grep "\["`
    if [ -z "$RESULT" ] ; then
        mv "$OUTP" "$OUTP_OK"
    fi
    fi
done
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T17:43:58+00:00Added an answer on May 27, 2026 at 5:43 pm

    If you would not be able to find similar already cooked in PowerShell, your only chance is to understand this script’s logic and write one in PowerShell from scratch since there are big differences.

    Look at the difference in syntax/commands and make appropriate translation. Some Bash vs Powershell related posts/docs available in web, e.g. this. And of course refer to PowerShell Getting Started manuals. For example syntax for for is different, for PowerShell it is:

    for (_init_, _cond_, _incr_) { 
       _operators_
    }
    

    BTW, in your case it’s better to use foreach, i.e. having something like:

    (get-childitem $path -Recurse | select-string -pattern .avi | % {$_.Path} > matchingfiles.txt)
    $FILESARRAY = get-content matchingfiles.txt
    foreach ($FILE in $FILESARRAY)
    {
    (get-content $FILE ) |foreach-object {$_ -replace $find, $replace} | set-content $FILE
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a JSP which attaches a XSL to an XML document pulled from
I am using c#.net I have two times pulled from a database (‘earliest start
I have several strings that have been pulled using cURL from another website. The
I have a folder pulled from a wordpress installation, >1000 files. Some php code
Howdy, I have a DataRow pulled out of a DataTable from a DataSet. I
I have a report where the fields come from data pulled from a SQL
Have just started using Visual Studio Professional's built-in unit testing features, which as I
After I have pulled from origin master branch( git pull origin master ), how
I have a complex table pulled from a multi-ActiveRecord object array. This listing is
Is there a way to find how many times people have fetched/pulled from your

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.