powershell - String comparisons not comparing -


I am trying to run a PowerShell script to delete some files in a directory. To be able to remove this name from me, it should be blahblahblah .

In my tests subdirectory, I have several files with the same name I though when I execute the following code:

$ itemsToDelete = get-childItem- Path $ pathName | Where {$ _. Name-blahblabla} "

It does not select any item.

I have a triple check to make sure that I am in the correct directory When the script is executed,

edit

as I have been told. I am included in wrong way and I am using.

  $ itemsToDelete = get-childItem-path $ pathName | where {(includes $ _. name) .In ( "Blablablah")}  < / Pre> 

correctly My confusion.

My comment (again with some background) again on the author's request.

quote:

  archival Description: the prevention tells the operator. that includes a collection of test values ​​of reference values. forever Boolean value. the reference values At least one. When the value of the test is a collection, the operator involved in it uses the reference equation. B returns returns when one of the values ​​in the test is an example of an example object   

In short, -compatible does not tell you that a There is a special sub-string in the string. You want -Match or -write for it to note that -Match assumes your test value so that you need to avoid special characters Ho.

My idea is that -complete is neither very intuitive nor very helpful theoretically it is understandable to speak such things if you support the idea, but one They are somewhat higher for the script language.

Comments

Popular posts from this blog

java - ImportError: No module named py4j.java_gateway -

python - Receiving "KeyError" after decoding json result from url -

.net - Creating a new Queue Manager and Queue in Websphere MQ (using C#) -