What is the best way to run a powershell script with parameters in the Task Scheduler?

Hello, 
Want to run the following from a scheduled task in the Task Scheduler on a server.  What is the best approach?
.\pscript.ps1 -csvfile "\\Srv1\Share\File.txt"
Thanks for your help! SdeDot

Hi,
To run a powershell script with parameters in the Task Scheduler:
Program: C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
Add argument (optional): -Command "& c:\scripts\test.ps1 -par1 2 -par2 3"
Hope the below two articles be helpful for you:
Schedule PowerShell Scripts that Require Input Values
https://blogs.technet.com/b/heyscriptingguy/archive/2011/01/12/schedule-powershell-scripts-that-require-input-values.aspx
How to Schedule a PowerShell Script
http://dmitrysotnikov.wordpress.com/2011/02/03/how-to-schedule-a-powershell-script/
Regards,
Yan Li
Regards, Yan Li

Similar Messages

  • Using TestStand 2.0, what is the best way to run a smaller sequence, in parallel to the main sequence, and access the main sequence's FileGlobals?

    I did ask this a while back and appreciate your responses. We did upgrade to TestStand 2.0. The basic problem is that I have written and TestStand sequence to test Avionics black boxes. We use Excel to specify the signal names and input data and expected output data for thousands of test cases. My LabVIEW VI's are small generic modules that refer back to TestStand to determine how to set or get the signals. This way, on other projects, we simple change a few signal names, instruments, and were good to go. We use Analog, Digital, Pulse Trains, Synchro Resolvers, LVDT/RVDT, power supplies, logic analyzers, ... to perf
    orm these test. The TestStand sequence can run different black boxes on difference test benches based on the data contained with the TestStand FileGlobals. Now I have come across a special situation where in a couple of input signals are set based on a couple of output signals. I developed a short sequence to read the output signals, compute the values of the inputs signals, and set the instrument to send that data to the UUT for those couple of signals. Anyway, I have to reference the FileGlobals to determine what the instruments are and how to access them are used for the signals involved. Since I have a lot of FileGlobal data, I can not pass it as parameters to the parallel sequence.
    What I would like to be able to do is just reference the main sequence's FileGlobals as if they were the parallel sequence's FileGlobals.
    I am willing to send a copy of the sequence being used to whomever thinks they know a good way to accomplish this if it would help them to determine what I am t
    rying to do. I will need to know who you are since we do not want this being published, as is, since it contains some signals names which the company that I am consulting at may consider proprietary. You can
    email me directly at my company
    [email protected]

    a) If the parallel sequence is in the same file and...
    a1) ...you launch the parallel sequence as a thread in the execution of main sequence, you do not need to do anything. The sequences share the same file globals
    a2) ...you launch the parallel sequence as a separate execution, you must mark the file globals as shared by all executions. You specify this in the Sequence File Global control on the sequence file properties dialog box.
    b) If the parallel sequence is in a different file (or even the same file), you can pass the entire set of file globals as a single sequence parameter to the parallel sequence when you launch it. Make a Container parameter and right click on it to turn off type checking. Pass FileGlobals to the parameter. When you edit the subsequenc
    e, you won't be able to see specific file globals under the parameter but they will appear at runtime.

  • Run a powershell script with domain credentials during task sequence

    I have a powershell script that adds the computer it is run on to a security group.  If I log onto the computer with a domain account it works perfectly.  However, if it is run while logged on as the local admin account it fails with an error message
    that says the domain either doesn't exist or cannot be reached.
    This is a problem because when a computer is being imaged the process runs with the local admin account.  Is there a way to run this script with domain credentials in the task sequence?
    Thanks,
    Andy

    How are you running the Powershell script? If you use a Run Command Line step, you can specify an account to run as. Something like "powershell %scriptroot%\psscript.ps1" where the psscript.ps1 is located in your Scripts folder in your deployment
    share.
    -Nick O.

  • What is the best way to run Sage on a MacBook Pro?

    What is the best way to run Sage on a MacBook Pro?  I am a first time Apple user.

    There's a lot of Sage out thete so fill us in with information. If it runs on Windows then you'll need to create a partition on your mbp using boot camp and install Windows. So what is Sage for you?

  • What is the best way to run windows on my Mac? And What are the pitfalls I should watch for?

    What is the best way to run windows on my Mac?   What are the pitfalls/

    If you need Windows as your main operating system you would be better off buying a Real Windows PC.
    Running windows on a Mac is always a compromise. Whether in a Boot Camp partition or in a Virtual Machine.
    In boot camp you can't easily Re-Partition and or Re-Size the drive it is installed on. You can't use both graphics cards as Apple has limited Windows to use the discrete graphics only, that is if your mac has 2 graphics cards (15" MBPs), which will shorten the battery run time in Windows.
    The trackpad only has limited functions in Windows, less then is available on the Mac side and a real Windows PC.

  • What's the best way to run Logic Pro from external hard drive.

    What's the best way to run logic from external hard drive

    Hi
    Organism wrote:
    Logic is designed to run from your Applications folder. I suspect if Logic was moved to an external drive, it might not be able to locate its assets, like loops and libraries.
    As long the necessary files are in the correct places on the boot disc, you can run the Logic application itself fom wherever you like. It would not be recommended however, and there would be very little benefit (if any) in doing so.
    CCT

  • What is the best way to run .exe files on my mac?

    What is the best way to run .exe files on my mac? I need to run some updates for my john deere gps and the downloads i get can only be run on windows.

    There are several options for running Windows software (*.exe files) on a Mac, depending what your program is, how often you use it, and your personal preferences.
    One way that does not require Windows is an open source effort called WINE.  Check out winehq.org.  You may find that that's all you need for your programs.  There is also a commercial effort that has grown from WINE, and you will find info about it on the site mentioned.  These DO NOT require that you have and install Windows.
    If you want to run sessions devoted only to Windows software, and want programs to run as fast as they do on a PC, the Apple's Bootcamp program is useful.  With it you dedicate a partition on your hard disk to windows, and on startup choose to either boot into OS X or Windows.  Each runs without any connection to the other.  This requires you have a copy of the Windows software as well as the applications you want to run. 
    If you want to be able to easily exchange data between your Windows and Mac programs, and skip back and forth between the two, there are several emulators available that run on Mac OS X and create a Windows environment where many Windows programs can operate along side Mac programs.  Parallels and VMwear are two comercial packages available for purchase and Virtual Box is an open source effort available for free.  Google will find all three for you.
    My only experience is with Virtual Box.  It is slow and a bit clunky, but it is free and meets my needs for the very few "just got to have" windows programs I sometimes use.
    Google is your friend on this and can provide a lot more, and better, information than I can.
    Best of luck,
    Ray

  • What is the best way to run windows on my mac?

    What is the best way to run windows on my mac?
    I have a particular program that i need to run, and it only runs on windows. I have a macbook pro

    As Templeton noted, it depends and will at least be somewhat subjective. 
    There are basically three options out there.  You can use a Windows emulator (Wine or the commercial version of it, Crossover Office), use Boot Camp to "dual boot" or use virtualization software (Parallels, VMWare Fusion, or VirtualBox).  Each has its advantages or disadvantages.
    The Windows emulators have the advantage of being the one option that doesn't need the purchase of a copy of Windows.  Unlike Boot Camp, but like the virtualization options, this allows you to run Windows programs and OSX programs side by side.  The big problem, though, is that it is the least compatible option--a lot of Windows software either has "issues" or will not function at all.  The Crossover website has information on which programs are known to work and how well they are known to work. 
    Boot Camp is the option that Apple ships OSX with.  You'll need a copy of Windows to install into the partition.  You'll effectively divide your disk into two parts and have two machines.  The major advantages are, first, you don't need to acquire separate software *AND* the Windows license.  As well, it's the highest performance Windows system.  What you have is truly a Windows machine.  That's both the good and the bad--you aren't going to be able to use OSX software at the same time, and you have to reboot to get back to OSX.  I've always thought it was best for someone who likes the Apple hardware and wants to use it for a Windows box--in that case Boot Camp is clearly a great solution.
    Finally there's virtualization which seems to be the most popular way to handle Windows, especially if you need to run one vertical market package.  It has the advantage of allowing you to use your OSX software at the same time, and the virtualization gives an extremely high level of compatibility.  About the only thing that won't run is a virtualization package (and there's not a lot of reason to run that in a Windows VM).  There is a performance hit compared to Boot Camp, but it's minimal for all but the most demanding applications (that being high end games). 
    It will chew up RAM on the OSX machine, but if you have at least 4 GB of RAM it will probably be manageable, especially if you only need to run one Windows program.
    You will need both a virtualization program (there are three major ones) and purchase Windows.  Two of three programs are commercial packages (Parallels and VMWare Fusion), while the other is an open source option (VirtualBox).  Virtual Box has the advantage of being free, but it's by far the least polished of the group.
    Which way is best?  As was noted, it depends.  I run VMWare Fusion on my machines, and I have used CrossOver Office for limited purposes.  I've not yet seen, in my use pattern, a reason to go to Boot Camp but I certainly can see cases where it might make sense.

  • What is the best way to reconcile gl account postings with pay results ?

    Hi experts
    what is the best way to reconcile gl account postings with pay results ?
    is it running wage type reporter ?
    or is there any otehr way .. i have variances in wtr n gl posting for a few employees.
    Regards

    Hi,
    Match Payroll Journal (PC00_M40_LJN - Payroll Journal ) with Wage type Report.(PC00_M99_CWTR - Wage Type Reporter )
    Finally verify the Posting amount (PCP0) with Payroll Journal....(PC00_M40_LJN - Payroll Journal )
    This should solve your issue...
    Regards,
    Veeram

  • What is the best way to hookup my airport extreme with my time capsule ?

    what is the best way to hookup my airport extreme with my time capsule ?

    It sounds like you have the AirPort Extreme configured as the "main" router on your network.
    If that is the case, connect an Ethernet cable from one of the LAN <-> ports on the AirPort Extreme to the WAN "O" port on the Time Capsule
    Power up the Time Capsule
    Connect another spare Ethernet cable from your Mac to one of the LAN <-> ports on the Time Capsule
    Open Macintosh HD > Applications  > Utilities > AirPort Utility
    Click on the Time Capsule, then click Manual Setup
    Click the Wireless tab below the row of icons and make sure that the setting for Wireless Mode = Off
    Click the Internet icon, the click the Internet tab
    Insure that the setting for Connect Using = Ethernet
    Insure that the setting for Connection Sharing = Off (Bridge Mode)
    Click the Update button at the lower right of the window and wait a full minute for the Time Capsule to restart
    Then power cycle the entire network by powering everything off....order of power down does not matter
    Wait a minute
    Power up the modem first, and let it run a few minutes by itself
    Power up the AirPort Extreme next and let it run a full minute
    Power up the Time Capsule next and let it run a full minute
    Keep starting devices one at a time about a minute apart until the entire network is back up
    You will need to reset the backup path from your Mac to the Time Capsule to get backups going again
    Open System Preference (gear icon on the dock)
    Open Time Machine
    Click Select Disk
    Click the Time Capsule to highlight it
    Click Use for Backups or Use Disk and backups should begin again in a few minutes
    If you do not want to leave the Mac connected to the Time Capsule by Ethernet, remove the Ethernet cable from the Mac to the Time Capsule, then log on to the AirPort Extreme wireless network

  • What is the best way to "upgrade" a powerbook g4 with a powerpc chip?  it seems that many things don't work or aren't supported these days.  can't update my iphone, download video, etc.  can i get the latest software?  thanks.Ask your question.

    what is the best way to "upgrade" a powerbook g4 with a powerpc chip?  it seems that many things are not supported these days.  can't download software, update my iphone, download video, etc.  can i get the latest software?  thanks for the help!

    Mac OS X 10.5 Leopard installation system requirements
    http://support.apple.com/kb/TA24950
    Leopard is no longer available at the Apple Store but may be available by calling Apple Phone Sales @ 1-800-MY-APPLE (1-800-692-7753).
    If you can't obtain a retail install DVD from Apple, look on eBay or Google the installer part numbers to possibly find at an on-line store. Here's what to look for:
    MB427Z/A  Leopard 10.5.1 install DVD
    MB576Z/A  Leopard 10.5.4 install DVD
    MB021Z/A  Leopard 10.5.6 install DVD (single user)
    MB022Z/A  Leopard 10.5.6 install DVD (5-user family pack)
    Installing Mac OS X 10.5 Leopard
    http://support.apple.com/kb/HT1544
    Mac OS X 10.5 Leopard Installation and Setup Guide
    http://manuals.info.apple.com/en/leopard_install-setup.pdf
    After you install the base 10.5, download & install the 10.5.8 combo update at http://support.apple.com/downloads/Mac_OS_X_10_5_8_Combo_Update
    The DVD should look like this
    Caution - Leopard does not support classic mode. So, if you currently open OS 9 apps in classic mode, you won't be able to do this if you upgrade to Leopard.
     Cheers, Tom

  • What is the best way to get dirty my hand with office 365

    what is the best way to get dirty my hand with office 365
    Anil MCC 2011,ITIL V3,MCSA 2003,MCTS 2010, My Blog : http://messagingschool.wordpress.com

    Hi,
    Just create an evaluation tenate and get your hands Dirty! Or if you are a partner to Microsoft, you can register yourself at
    http://portal.fasttrack.office.com and then you can create sites from there. If you need tenant with data, use
    http://microsoftcie.com and create a tenant, then you will have your own contoso to play with! :) 
    Regards
    Henrik A. Halmstrand
    sharepointrevealed.com
    getspconfig.codeplex.com
    Please click Mark As Answer; if a post solves your problem or Vote As Helpful; if a post has been useful to you.

  • What is the best way to have access to OSX and OS9 from the same machine?

    What is the best way to have access to OSX and OS9 from the same machine?
    Do I need to partition the hard drive? Installed both Tiger and OS 9 on the G5 and it is having problems starting up properly.
    G5   Mac OS X (10.4)  

    And here is the prove for Edwin's message: Macintosh: Some Computers Only Start Up in Mac OS X

  • What is the best way to zero a 'custom voltage with excitation' sensor from the front panel?

    What is the best way to zero a 'custom voltage with excitation' sensor from the front panel?
    Thanks for any help

    Hi Donavan,
    There are two options for zeroing with the NI-9237.  You can perform offset nulling and shunt calibration with a strain task, or if you use custom excitation you can use software compensation.
    See the Bridge Balancing, Offset Nulling section in  the Load, Force, and Torque Measurements tutorial. Take a measurement before the strain is applied and subtract this from all subsequent measurements.  See the above tutorial to consider the tradeoff in accuracy between these two options.
    Hope this helps,
    Jennifer O.
    Applications Engineer
    National Instruments

  • HT4436 What is the best way to set up business accounts with multiple ipads?

    What is the best way to set up business accounts with multiple ipads?

    Here are three different methods >
    How to use multiple iPods, iPads, or iPhones with one computer, http://support.apple.com/kb/HT1495
    This article > iOS: How to transfer or sync content to your computer, http://support.apple.com/kb/HT1296
    suggests using contacts groups.
    When syncing contacts, you can choose to sync all of your contacts or only selected groups.
    You can select a group of contacts to which all new contacts created on your iOS device will be added.
    You can set up groups in the Address Book application.
    If you are all going to use the same iTunes apps library, turn off "Automatically sync new apps" in the apps tab just below the list of apps.  Then you won't get new apps on your device unless you select them.

Maybe you are looking for

  • Data Federator with BW 3.5

    Hi Experts, We are using Data Federator and connected to our Client BW 3.5 Oracle Data base directly. We were looking to connect to below Cube and Ods tables InfoProviders Table Names InfoCube ZSD_BILDP /BIC/EZSD_BILDP, /BIC/FZSD_BILDP ODS Object ZDP

  • Icloud problem with Keynote

    My keynote presentation would upload to iCloud.  I have Keynote on my iPhone and Keynote (v. 5.20) on my MacBook Pro.  I'm running OS X Mountain Lion 10.8.2.  I dragged the presentation to the iCloud box and I see a "waiting" message underneath.

  • DMXZone support {subject edited by moderator}

    At the top level DMXzone is great for their templates and much of their add ons. But they are heavy on adding code.  ... When it comes to the deprecated functions which dreamweaver used to support- (linking databases to form data). DMXzone isn't work

  • 2 gamecenter accounts in 2 devices..

    Hello everyone, I already have a second game center account. When i tried to log in my 2nd game center acc to my 2nd device ( as i play coc), the data that will load is my old coc data. Why wont it start from the beginning? hope someone can help me w

  • Actions Layer will not  control navigation buttons!

    I created a flash menu inside my header for the website, and here is my problem, only some of my buttons are working. About half work, and half do not. When I click on the button, nothing happens. All the buttons are named and spelled correctly, but