nal2us224

Forum Replies Created

Viewing 15 posts - 1 through 15 (of 40 total)
  • Author
    Posts
  • in reply to: Changing text inside and existing XML file #264182
    Participant
    Topics: 13
    Replies: 40
    Points: 178
    Rank: Participant

    I have no code at this time.  Only that XML example which I shared earlier.

     

    Shukriya

     

    in reply to: Changing text inside and existing XML file #264146
    Participant
    Topics: 13
    Replies: 40
    Points: 178
    Rank: Participant

    This is the exact problem.   The unique value is the data INSIDE the tags.    I need to be able to differentiate one tag of the same name from another in code.   The fact that one tag may be the parent tag…. great!  I am assuming that will be the first tag listed.   The problem is the XML document will change from time to time the number of  “Same Name” tags it has in it, and the data will be different every time.  In the example above that I have listing three video files, the next XML sheet to be used will: 1.  have a different XML name altogether, 2. Have a different number of video files and associated “Same Named” tags, AND will have different data that needs to be updated in one, some, or all of the same named tags.   So again, some sample code of showing how to overcome these multiple issues in powershell would be appreciated.   I was thinking of something like regex expressions, but need some sample code showing how to overcome these multiple obstacles kvprasoon, or anyone else out there who can give me something other than a “general answer”.  Thank you and God bless you!!!

    in reply to: Looping an Entire PowerShell Script #263987
    Participant
    Topics: 13
    Replies: 40
    Points: 178
    Rank: Participant

    My thoughts exactly. Thank you

    in reply to: Changing text inside and existing XML file #263960
    Participant
    Topics: 13
    Replies: 40
    Points: 178
    Rank: Participant

    OK Tony, here is a sample of the XML I wish to change.
    Notice all the similar tag names:

    You will notice all the similar tag names. Can you provide some sample code of how to choose which tag gets the new data that I wish to input?

    in reply to: Looping an Entire PowerShell Script #263957
    Participant
    Topics: 13
    Replies: 40
    Points: 178
    Rank: Participant

    Let me ask you this Matt:

    How would you get that particular script you wrote to go off at the quarter mark, (15, 30, 45, top of the hour), of every hour in the day continuously?

    in reply to: Changing text inside and existing XML file #263630
    Participant
    Topics: 13
    Replies: 40
    Points: 178
    Rank: Participant

    Tony:

    Any scripting examples you would like to share based on your initial response please?

    in reply to: Changing text inside and existing XML file #263355
    Participant
    Topics: 13
    Replies: 40
    Points: 178
    Rank: Participant

    For Xpaths in PowerShell research I can find many examples and uses for this tool for a specific NODE. Doesn’t seem to work when you have multiple nodes with the same name within one XML document.

    Also the above mentioned tool has a primary use of Query inside XML document, not updating data with in a Node.

    Your thoughts Mr. Kvprasoon?

    • This reply was modified 3 months, 1 week ago by nal2us224.
    in reply to: Changing text inside and existing XML file #263322
    Participant
    Topics: 13
    Replies: 40
    Points: 178
    Rank: Participant

    ok thank you

    in reply to: Changing text inside and existing XML file #263265
    Participant
    Topics: 13
    Replies: 40
    Points: 178
    Rank: Participant

    Last thread is VERY HELPFUL for changing text in one node. i.e. <size>”Data Needing to be Changed”</size>.

    But what if that same XML file has multiple nodes with the same name? How can you tell PowerShell which node to apply the change to?

    i.e. <size>”Data Needing to be Changed”</size>

    further down in the script another instance of same thing:
    <size>”Data Needing to be Changed”</size>

    further down in the script same thing… and so on.

    How can powershell tell the difference so it knows which Node to place the data into?

    in reply to: Looping an Entire PowerShell Script #262955
    Participant
    Topics: 13
    Replies: 40
    Points: 178
    Rank: Participant

    Sweet Matt!!!

    I just tested it.

    Its perfect. I think I will only need the core component but your example definitely illustrates the point clearly.

    Thank you Sir and have a blessed day!!!

    in reply to: Looping an Entire PowerShell Script #262934
    Participant
    Topics: 13
    Replies: 40
    Points: 178
    Rank: Participant

    Thank you for the reply Matt.

    May I ask what the code would look like beyond its most basic?   Samples please?

     

    Thank you and God bless you Sir!!!

    in reply to: Timer to turn off automated task – Update #262799
    Participant
    Topics: 13
    Replies: 40
    Points: 178
    Rank: Participant

    That script is beautiful Rob. It is exactly what I needed. Thank you so much!!!!

    in reply to: Timer to turn off automated task – Update #262784
    Participant
    Topics: 13
    Replies: 40
    Points: 178
    Rank: Participant

    Thank you very much and have a blessed day!!!

    in reply to: Timer to turn off automated task – Update #262775
    Participant
    Topics: 13
    Replies: 40
    Points: 178
    Rank: Participant

    Ok Rob understood and thank you for that clarification. Having said that if “File Watcher” is NOT the solution can you provide a sample of what would be a viable solution? I only need to scan the folder once per run, keep the scan active for a predetermined period of time and then cease that operation.

    Please advise.

    Thank you Sir for your valuable input!!!

    in reply to: Timer to turn off automated task – Update #262748
    Participant
    Topics: 13
    Replies: 40
    Points: 178
    Rank: Participant

    Forgive my amateur use of the term “polling” Rob. Yes you are correct. I want to place a command at the end of the script I shared that causes the polling function to completely CEASE as the code I shared is part of a bigger script. Then the rest of the code will run and at the end of the script I will LOOP the entire script which will allow the code to run once more , then once again stop, until the next run of the script from the loop. Make sense Sir?

    The sample code from the link you shared seems to do the job except for one problem. The user STILL has to manually push CNTR + C to execute the unregister sequence.
    I need some sample code that will emulate the CNTR + C Keystroke in code without the use for manual input.

    Any Ideas?

    • This reply was modified 3 months, 2 weeks ago by nal2us224.
Viewing 15 posts - 1 through 15 (of 40 total)