Created
April 10, 2020 19:20
-
-
Save buaziz/562d1b0c1486215d27ab8f0d63ee5ec4 to your computer and use it in GitHub Desktop.
PowerShell DevOps Task - Get file name without Extension and set Task Variable
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $input_path = "C:\Folder-to-Search\" | |
| foreach($file in Get-ChildItem -Path $input_path -Recurse -Include *.cs) | |
| { | |
| Write-Output "fileName : $($file.BaseName)" | |
| Write-Host "##vso[task.setvariable variable=DevOpsVariableToSet;]$($file.BaseName)" | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment