We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 08b1456 commit 50578faCopy full SHA for 50578fa
Search-PipeScript.tests.ps1
@@ -0,0 +1,29 @@
1
+describe Search-PipeScript {
2
+ context 'Searching PowerShell' {
3
+ it 'Can search for AST types within a ScriptBlock' {
4
+ {
5
+ "hello world $message"
6
+ } | Search-PipeScript -AstType variable |
7
+ Select-Object -ExpandProperty Result |
8
+ Should -Be '$message'
9
+ }
10
+
11
+ it 'Can search within an AST' {
12
13
14
+ }.Ast |
15
+ Search-PipeScript -AstType variable |
16
+ Select-Object -ExpandProperty result |
17
18
19
20
21
+ context 'Searching text' {
22
+ it 'Can search text, too' {
23
+ '123' |
24
+ Search-PipeScript -RegularExpression '\d+' |
25
26
+ Should -Be '123'
27
28
29
+}
0 commit comments