最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Is there a way to search the contents of a PowerShell object for a string and return its location? - Stack Overflow

programmeradmin0浏览0评论

Let's say we have an obect '$fruit', whose output is:

Shapes: Container.Fruit.Shapes
Sizes: Container.Fruit.Sizes
Colors: Container.Fruit.Colors

Each of those entries contains more information, so if we do, say, '$fruit.Colors' we get:

Reds: Container.Fruit.Reds
Greens: Container.Fruit.Greens

And then if we do '$fruit.Colors.Reds' we get:

ColorName ColorList
--------- ---------
Reds      Scarlet, Burgundy, Crimson, Cherry, Ruby

Is there a way to search through the contents of '$fruit' for a string and then have it return the location of that string within the object? For example, a way to search for 'Crimson', which would then return '$fruit.Colors.Reds.ColorList'?

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论