Determine the end of the month and then run the script

Hi all

OK, I'm stumped. I can get all kinds of data to date... but I did not find a way (or the same example script) that shows how to retrieve the end of the month.


Why?


I have a master script that runs as a scheduled task. It runs every day and call other scripts based on the date. It is great for things like weekly reports that I just used $dow = {get-date}. DayofWeek but I need to run scripts at the end of the month.

I can something together that gets the day, and then performs a logical ugly pop-based < or > but I don't know there's a smoother way to do.

As always, any help greatly appreciated.

See you soon

Hello, medalklector-

One way to do it, it is described by RMToups, Jr. at http://activelydirect.blogspot.com/2011/01/determine-last-day-of-month-in.html.  You should be able to set the output to fit your needs.  How does do for you?

Tags: VMware

Similar Questions

  • If I buy 1 annual contract with monthly payment app am I then linked throughout the year, or can I cancel after 3 months and then not pay the rest of the year?

    If I buy 1 annual contract with monthly payment app am I then linked throughout the year, or can I cancel after 3 months and then not pay the rest of the year?

    I found the answer myself via chat. the answer is Yes, you can cancel, but you must pay 50% of the remaining months of the annual contract

  • I need help! I try to open my PDF but I get this message on my Macbook Pro! "Before you display PDF documents in the browser, you must launch Adobe Reader and accept the end user license agreement, and then quit and relaunch the browser."

    I need help! I try to open my PDF but I get this message on my Macbook Pro! "Before you display PDF documents in the browser, you must launch Adobe Reader and accept the end user license agreement, and then quit and relaunch the browser." What should I do?

    Do exactly what the message says, and it will go away.

  • Wait for the host disconnects and then run a command

    Hello world

    I have a stop script for my virtual infrastructure, now I have to add code to stop an Equallogic AFTER the last host table is turned off.

    I know the commands to do this, but I need help to write a loop that will test the ip address of the last host management and wait until this station responds to pings.

    In my script I have to establish what host will be put off to the end so it's not a problem... How can I keep ping IP management host to die and then run the commands Equallogic?

    I hope that I managed to explain to me... I was exploring the Test-Connection cmdlet but it seems that it displays che echo of the ping instead of State... I'm a bit lost around this, can someone help me please?

    Something like that would do the trick?

    $count = 0

    $maxWait = 10

    {}

    $count += 1

    Write-Output "$(get-date-f HH) $(get-date-f JJ/MM/AAAA)-host is offline."

    sleep 5

    } until (!) (Test-Connection 192.168.110.85 - BufferSize) count 16-1 - calm)- or ($count - gt $maxWait))

    If {($count - gt $maxWait)

    Write-Output "Host always online."

    }

    else {}

    Write-Output "$(get-date-f HH) $(get-date-f JJ/MM/AAAA)-host is offline."

    }

  • installation of windows xp/vista/7 on USB and then running windows FULL of her not ONLY START from USB

    is it possible to install windows xp/vista/7 on a USB key and then run the FULL version of windows of him anywhere I want? Please, I beg you!

    Friday, January 28, 2011 18:56:58 + 0000, tupac shakur says:

    is it possible to install windows xp/vista/7 on a USB key and then run the FULL version of windows of him anywhere I want? Please, I beg you!

    # With all these versions of Windows, the installation is
    customized for specific hardware. This will not work on different
    material.

    Ken Blake, Microsoft MVP

  • How do open Applescript AI can open the file and then run ExtendScript then close?

    Here is the code sample Applescript that I came with the help of the script guide/reference for CS6 and by doing some research online:

    Tell application "Adobe Illustrator"

    activate

    period of 10

    pfilepath the value "/ Users/username/Documents/Temp/someFile.ai".

    the pfile POSIX file pfilepath value

    Open the pfile as alias without options

    period of 10

    do javascript "#include" / Users/username/Documents/Temp/someScript.jsx ".

    delay 1

    quit smoking

    tell the end

    I just want to open the app (example here for, but also pleasant to do same for Photoshop), open a file, then run the ExtendScript file against her, and then close after treatment. With this example script, all that works is the app starts. No file not opened, any script executed, app does not close at the end. I see no error doesn't pop up or anything appear in the command prompt.

    Just ExtendScript sample triggers an alert popup for the test message

    Also note, the Applescript code snippet is executed from Python, but I think where/how it runs shouldn't matter (except perhaps where the error messages may appear). But in the worst case, I'll debug/run through the AppleScript Editor.

    Some tips on what's not here? Or is it technically correct?

    It solved here: MacScripter / POSIX Pass file path to Adobe Illustrator to run ExtendScript

  • Trying to download a game that won't play, I asked for help on the game site and they start saying "click on start and then"Run". Try as I might I can't find "run". Any suggestions

    I am unable to find the 'run' which, according to the website of the game should be pinned to my button 'start '. Any ideas?

    I am unable to find the 'run' which, according to the website of the game should be pinned to my button 'start '. Any ideas?

    It is an older version of windows.  In 7 or Vista, click Start, and then use the search box - enter the article they say "run" and press ENTER.

  • Can I subscribe to creative cloud for a few months and then cancel?

    I was keen to subscribe for only a few months, while I'm at school. I wanted to pay by the month. Can I do this? If Yes, I have to pay cancellation fees?

    You can!

    Nut at the moment I'm trying to get rid of my subscription monthly and of course... Nowhere, he know how to do this.

  • In another thread - another method and then run Sub...

    I wrote a method to extract a string from a webpage using StreamConnection and it works perfectly... except that it runs on the main thread.  I wonder if there is a simple way to have a method that returns an object (String in this case) something to run on a thread and return it to the first thread.

    Everything I try the only thing I can get to work on the second thread is what's on the run method void, but that returns nothing... because it sucks...

    Until now what I thought is to pass the variables I need in the constructor, then set the connection stream real term where I want retruned is written in a class variable and another method that returns the class variable that has been filled with the run method... but that doesn't seem to just... thought he worked in a simple test I ran...

    A slightly different way (but completely equivalent) to work in a another thread is to create a class that implements Runnable and feed a thread. If, for any reason, you do not want to expand Thread (because your worker class extends already something else and it would be difficult to refactor), then this variant is a lifeline. You do something like this:

    class WorkerClass extends AnotherClass implements Runnable {    // ...    public void run() {       // do time-consuming work here    }}
    
    // later...WorkerClass worker = new WorkerClass();// initialize worker object. Then: new Thread(worker).start();
    

    As it is easy to turn a class in an executable (you simply add "implements Runnable" and a run() method), it's an easy way to avoid the subclassing Thread.

    Regardless of how you use to perform work in a separate thread, there is always the question of how to get the results. With the help of the observer is a common way to handle this, but in general, this means that the results are returned in the worker thread, not the thread from the main event. If you want to update the user interface, this can be a problem. Another approach is to structure your code something like the following:

    /** * Process the results of some time-consuming operation. */public void acceptResults(ResultType result) {  // ...}
    
    /** * Start a thread to carry out time-consuming work in a * separate thread and deliver the results back in the * event dispatching thread. */public void launchWork() {  new Thread() {        public void run() {           final ResultType res = computeResults();          Runnable r = new Runnable() {                public void run() {                   acceptResults(res);               }         }         Application.getApplication().invokeLater(r);      }
    
           /**        * Do time-consuming work in this method       */       private ResultType computeResults() {         // connect to server, interpret reply, etc.       } }.start();}
    

    You have the right idea that is running in a thread separate is how to manage a time consuming task. The point of all, however, is that you (the event dispatching thread) don't want to wait for the task at hand. Both the observer model and the code here offer a solution for a worker thread to do the work without blocking the thread of the event. The invokeLater() method was kindly provided by BlackBerry people to give the worker threads neatly transfer control on the event dispatching thread when needed.

  • Error when you try to clone a virtual machine and then call a script ExternalWFStubs.MachineProvisioned powercli

    Vcac 6

    Hello, I am running a script ExternalWFStubs.MachineProvisioned powercli.  I was using Call of Scripts Powershell/PowerCLI since a Workflow vCAC as reference.

    The script works well after the virtual machine is configured, and it does what it is supposed to do, but the deployed virtual machine is removed when it is finished and the following error is thrown.

    Workflow: WFStubMachineProvisioned

    Details of the results: failed with the following exception: cannot call this function because the current host only implements it.

    Has anyone another vu cela and know what is happening?  I will continue to check and post back with what I find.

    Thank you

    You are able to share the PowerCLI?

    Grant

  • Can I connect to SQL * more as SYS after connecting as a user and then run a GRANT?

    Oracle 11 g 2

    Linux RHEL 6.3

    SQL * Plus 11.2.0.2 on Windows 7

    ------------------------------------------------

    I am running a script SQL through SQL * more connected as "DOE, JOHN".

    In the SQL script, I need to connect as SYS to make a GRANT EXECUTE on a SYS package (e.g. GRANT EXECUTE ON DBMS_CRYPTO to JOHN;).

    But it fails with the following error:


    GRANT EXECUTE ON TO JOHN DBMS_CRYPTO
    *
    ERROR on line 1:
    ORA-01917: user or role 'JOHN' does not exist

    But of course, 'JOHN' are.  The rest of the SQL script is running "DOE, JOHN" without any problem.

    The code segment of SQL script in question is:

    connect sys/password as sysdba
    GRANT EXECUTE ON DBMS_CRYPTO TO ROYSECITYDATA;  <-fails here
    to connect/DOE

    Please advise on what my being the issue.

    tx103108 wrote:

    I connect to a remote database.  All dbs distance have the same instance name as they are all images.  I see where you're going (I think).  Should I try

    I'll try to connect sys/password@MYDB

    Sounds like a plan... (the instance_name returned with what you expected? or something else?)

  • After the installation of 8500 a909n printer works wireless for a few months and then quit?

    Wireless worked for two months after the installation of replacement printer, then he stipped works, but still compatible with USB. Technical support phone could not operate either. What should do?

    Nothing that I said. The printer was a replacement for one that would not connect at all, then the tech team India talking my client through cannecting it then a few months later it stop responding wireless but worked hard when the USB is connected. I was able to remedy through the convenience store a couple of times and selecting the difficulty of choosing the default printer for the correct choice rather than the fax machine. I chose HP officejet (network). Thank you for your time.

  • AA6 - moving at the beginning/end of a selection and then uncheck the box

    Hello...

    In AA3 - you could make a selection, then click on at the beginning/end of the selection.  This will deselect the selection and move the playhead to the post.

    In AA5.5, you would use the left/right arrows to perform the same task.

    In AA6, nor work.  If you left/right arrow, the playhead moves but it moves to the bottom to the top of the timeline (not for the start/end), and it is not clear.  CTRL + left/right arrow move the playback head to appropriate locations (as well as other places), but it is not clear.

    Is it possible to do this with AA6?

    I used it a lot in making the track for cd breaks (home, shift + click at 05:00, f8, arrow right, shift + click at 10:00, f8, etc...).  I also used it where I wanted to have only 0.5 seconds of extra silence at the beginning/end of some audio (click at the beginning of the audio, drag back 0.5 seconds, left arrow, shift + home page, delete).

    JJ

    We have changed many commands in hearing CS (and some between CS5.5 and CS6), but most of what you could Audition 3, you can still perform in Audition CS6.

    For this: home, shift + click at 05:00, f8, arrow right, shift + click at 10:00, f8,.

    Try this: home, shift + ctrl + arrow right (or W), a click at 05:00, f8 (or M), ctrl + d, shift + click at 10:00, f8, etc...

    You can find all our new commands and default in the dialog box keyboard shortcuts shortcuts keyboard (Edition > hotkeys...)

    -Ron

  • every time I have try and watch a pdf file I get this message - before displaying PDF documents in the browser, you must start Adobe Reader and accept the end user license agreement, and then quit and restart the browser.  How can I do this?

    Help, please

    I found the solution on a very old web site.  Start the application and press tab & enter.

    That's it.

  • install new printer Epson WF-2530, will not install scanner drivers error message ' could not launchrequired program during installation, check the installation disc, and then run the installation again.

    having a problem installing drivers for a new Epson printer scanner all in a WF-2530 on my desktop using windows vista

    error message "could not launch the required program during installation, check the installation disc, then re-run the installer.

    I managed to install the software on my laptop using windows 7.

    spending some time with epson tech dept, after several attempts to solve the problem, they advised that it was a problem with the microsoft software.

    have tried to install it on the internet from the site of epson, but same error

    any help would be greatly appreciated

    < have="" tried="" installing="" over="" internet="" from="" epson="" website="" but="" same="">
    Do you mean that you have downloaded the Epson driver?

    http://www.Epson.com/cgi-bin/store/support/supDetail.jsp?BV_UseBVCookie=Yes&infoType=overview&OID=209709

    Try using the wizard adding printer in the Control Panel, printers. In the wizard, select EPSON under manufacturer. If you don't see your printer in the list, click the Windows Update button. It will take several minutes (about 20) be patient, Windows updates the list. You should see a hard drive activity during the update.

    If that wouldn't work, try to run the System File Checker:

    Use the System File Checker tool to troubleshoot missing or corrupted on Windows Vista or Windows 7 system files
    http://support.Microsoft.com/kb/929833?WA=wsignin1.0

Maybe you are looking for