help wanted
2 TopicsScript to copy MS Excel files from one location to another and keep a log
Hi Not sure if PowerShell is design for this, I was thinking back to the days when you would create a BAT file. I am wanting to automate the process of copying 2 MS Excel files; each has a separate defined name, the source name never changes but the files are used constantly so someone may have these files open. 1. Script to copy the two files regardless if they are open at source. 2. Save each file to a new location(could be two separate location for each) with a new filename using the following naming convention "dd-mm-yyyy - hhmmss - <Existingfilename>" ...etc 3. Also, create a simple log or txt to record each file being transferred, log the new filename, outcome; fail or saved, date, time and file size when it was transferred. Save the txt file to a local folder, so over time I will build up a record when files are transferred. 4. Is it possible to have a window or progress indicator which has information for the user to see how the operation is progressing. 5. A fail safe, if the transfer does not work alert the user and stop the process, plus if feasible log the failed outcome as per step 3. ChrisSolved12KViews0likes7Commentsset alias for Power BI
My Windows 10 Pro has Anaconda Powershell Prompt, and its $PSVersionTable is: Name Value PSVersion 5.1.19041.1682 PSEdition Desktop PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…} BuildVersion 10.0.19041.1682 CLRVersion 4.0.30319.42000 WSManStackVersion 3.0 PSRemotingProtocolVersion 2.3 SerializationVersion 1.1.0.1 I have to “run as Administrator” in order to run commands in Anaconda Powershell Prompt. I’m unfamiliar with its commands though, except to activate a conda environment. After I’ve activated a conda environment (that’s customized for Microsoft Power BI Desktop), I can start the program at C:\Program Files\WindowsApps\Microsoft.MicrosoftPowerBIDesktop_2.105.664.0_x64__8wekyb3d8bbwe\bin\PBIDesktop.exe . Since that path is so long, I want to create a program alias. I followed the instructions to add a new keyin Registry Editor. But why do I get the error: start : This command cannot be run due to the error: The system cannot find the file specified. At line:1 char:1 start PBIDesktop + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand P.S. if I click on the shortcut icon for Power BI after activating the conda environment, Power BI will still show a Python script error. Apparently, it still needs to be started from the conda environment.1.9KViews0likes5Comments