Skip to main content
Filter by
Sorted by
Tagged with
2 votes
1 answer
196 views

I'm using Named Captures in PowerShell. But the following example is not returning all matches. All the lines in the following code return correct output - except the lines 7 and 8. I was expecting $...
nam's user avatar
  • 24.3k
1 vote
1 answer
67 views

In Powershell, a pipeline can contain filters such as ForEach-Object: get-process | %{$_.name} Within the script block of the foreach filter, it's possible to use the $_ auto variable to refer to the ...
Dess's user avatar
  • 2,739
1 vote
1 answer
165 views

I want to use the match pattern of a Makefile rule in a text function in the perquisites list. Let's say I want to build a file, and that files perquisites are any other files with the same name in a ...
111111's user avatar
  • 16.3k
3 votes
1 answer
1k views

With bash I can create a directory and immediately enter it with mkdir mydir && cd $_. Is there a powershell equivalent of $_?
Dominik's user avatar
  • 194
2 votes
1 answer
932 views

What does @$ mean in the below make recipe ? @$(OBJCOPY) -S --set-section-flags .bss=alloc,contents -O binary $(BINARY).elf $(BINARY).bin Thanks
potato's user avatar
  • 199
1 vote
3 answers
211 views

I've a makefile that is suppose to repeat an execution of a c code (BootstrapCL.c) one time for each file.csv in the directory. For each execution it should give in input to the c code (as argv) 2 ...
user1172131's user avatar
1 vote
1 answer
637 views

I want to use start-job to run a .ps1 script requiring a parameter. Here's the script file: #Test-Job.ps1 Param ( [Parameter(Mandatory=$True)][String]$input ) $output = "$input to output" ...
Ben Adams's user avatar
  • 129
0 votes
1 answer
503 views

I have this Makefile (and GNU Make): vpath %.o .objs OBJDIR=.objs all: symbol_tests.so symbol_tests.so: symbol_tests.o symbol.o # simulate linking @echo Linking target: $@, prerequisites: $^ ...
thoni56's user avatar
  • 3,413
5 votes
2 answers
5k views

I'm trying to figure out how I can pass multiple strings as an array to a powershell function. function ArrayCount([string[]] $args) { Write-Host $args.Count } ArrayCount "1" "2" "3" ArrayCount "...
Tom Deseyn's user avatar
  • 1,925
5 votes
3 answers
4k views

I am trying to pipe an array of strings to write-host and explicitly use $_ to write those strings: 'foo', 'bar', 'baz' | write-host $_ However, it fails with: The input object cannot be bound to ...
René Nyffenegger's user avatar
0 votes
1 answer
1k views

In bash, to get argument from last command we call $_. I have searched but couldn't find what is equivalent to bash's $_ in PowerShell ? Example: $ mkdir 20171206 $ cd $_ Now bash current working ...
Raja G's user avatar
  • 6,803
9 votes
3 answers
16k views

Problem I am working with Jenkins to deploy PowerShell scripts remotely. As such, I am trying to figure out if there will be problems utilizing $PSScriptRoot over $MyInvocation.MyCommand.Path for ...
Brandon's user avatar
  • 771
3 votes
1 answer
3k views

I was studying ANSI C programming language and it says in introduction: "Local variables are typically "automatic," or created anew with each invocation." I'm guessing allocating and deallocating ...
Michael's user avatar
  • 585
4 votes
2 answers
4k views

I am writing some PowerShell scripts to do some build automation. I found here that echo $? returns true or false depending on previous statement. I just found that echo is alias for Write-Output. ...
VivekDev's user avatar
  • 26.1k
0 votes
1 answer
275 views

I am using automatic variables with static pattern rules in a Makefile, but I have a problem with filenames with parentheses. The parentheses are not escaped properly for the shell, and I get a syntax ...
reynoldsnlp's user avatar
  • 1,285
2 votes
2 answers
608 views

I'm new to makefiles, and they puzzle me. I have the following folder hierarchy: A folder named lib contains tow folders: include (with file mylib.h) and src (with file mylib.cpp). It also contains a ...
limitIntegral314's user avatar
1 vote
1 answer
574 views

Lets assume, i want to call make somepath/abc.pot which depends on somepath/somefiles.c My target I've created so far looks like %.pot: $(dir $@)*.c @echo "it works" ifeq (,$(wildcard $@)) # ...
user2790498's user avatar
1 vote
1 answer
62 views

I'm making once which compiles some sort algorithms that i made. I have a structure like this: |/sorting_algorithms |----/bin |----/build |----/include |--------tiempo.h ...
Alejandro's user avatar
4 votes
2 answers
1k views

What works - Lets say I have a scriptblock which I use with Select-Object cmdlet. $jobTypeSelector = ` { if ($_.Type -eq "Foo") { "Bar" } elseif ($_....
Vikas Gupta's user avatar
  • 4,480