1

My file structure looks like this:

maindir/
  - subdir/
      - file1.ts
      - file2.ts
  - file3.ts
  - file4.ts

I'm trying to build typescript interfaces using ts-interface-builder, and I want to match and build all 4 file*.ts files. (ts-interface-builder just builds the types, this question is mainly about the matching pattern / wildcards in Windows Powershell since I'm used to Unix).

I'm currently using this command:

npx ts-interface-builder ./maindir/*.ts

But this only builds file3.ts and file4.ts. I could use a slightly different command:

npx ts-interface-builder ./maindir/*/*.ts

But it only builds file1.ts and file2.ts.

I tried researching Windows Powershell wildcards but wasn't able to figure it out. Is there a single command I could use to build all 4 files?

1 Answers1

2

Assuming that your npx command is executed by / from PowerShell:

npx ts-interface-builder (Get-ChildItem ./maindir -Recurse -Filter *.ts).FullName

See also: The Get-ChildItem cmdlet.

mklement0
  • 382,024
  • 64
  • 607
  • 775