Best resource to ask simple questions?

I have a moderate grasp of programming languages I am just looking for someone ( maybe a discord or something ) that would answer simple one off questions.

Here is my first question while I’m here –

I need to multiple files for a multi line text that looks like this

config set param 1 set param 2 ! 

And there are multiple instances in the file of the “config block” (different names, just example) I want to “grep out” all of the config blocks so that I can search them for specific configs

$contents = get-contents .basic.cfg | Out-String

$contents | Select-String -Pattern “^config.+!” -AllMatches

contents has the file, but even if i do a simple “select-string” it just spits back the file contents. My initial thought is select-string doesn’t work on an actual string object but like i said simple questions.

I’m storing it in a variable for later searches.

I’m stuck in powershell 2.0 for now

submitted by /u/mjr2015
[link] [comments]

Leave a Reply