Jump to content
Ketarin forum

Can textual content values be accessed from PowerShell?


JoelK
 Share

Recommended Posts

I am trying to write a PowerShell script that runs after any application is updated that will among other things record the version number of the newly updated application to a file. If I have an application where {version} is defined as a regex match of URL contentsĀ and I do something like this:

$app.Variables.version.CachedContent | Out-File -FilePath "E:\test\$($app.Name).txt"

I will get the version number written to a text file named after the application as expected. However, if I have an application where {version} is defined as the following textual content (where {versionraw} is already defined as a regex match of URL contents and the below does some formatting of that value):

{versionraw:replace:_:.}

and then I do something like this:

$app.Variables.version.TextualContent | Out-File -FilePath "E:\test\$($app.Name).txt"

the text file will not contain the version number (e.g. 9.1.5) but rather what I actual function from the textual content field ({versionraw:replace:_:.}). I know {version} contains the value I expect because if for example I set the download location to "E:\test\{version}.msi" the file will be saved as "9.1.5.msi". So, how can I get the value of {version} in PowerShell when {version} is textual?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.