Page 1 of 3 123 LastLast
  1.    05 May 2017 #1
    Join Date : Feb 2017
    Home
    Posts : 480
    Windows 10 Home x64, V1709 (16299.64)

    I Need Some Powershell Education


    Since the days of an Autoexec.Bat and the Config.Sys, I've kept a directory/folder named Utilities for Batch Files and small programs that do not require installation. It's always been on "the path" for obvious reasons. With the coming of CU and Powershell replacing the Command Prompt, I've been learning something about PS. It's been said that anything I can do from the Command Prompt, I can do in PS. Well I must have something wrong. Here's my setup now and none of my Batch Files or "little" programs run in PS:

    Click image for larger version. 

Name:	1-Capture.PNG 
Views:	47 
Size:	22.1 KB 
ID:	133631

    Click image for larger version. 

Name:	2-Capture.PNG 
Views:	47 
Size:	9.3 KB 
ID:	133632

    How do I get the Utilities folder in a path that PS will read?

    Thanks for any attention and help.
      My ComputersSystem Spec
  2.    05 May 2017 #2
    Join Date : Dec 2013
    Sydney, Nova Scotia, Canada
    Posts : 10,449
    Windows 10 IoT

    This may or may not help but command prompt is till there. Settings > Personalization > Taskbar > Replace Command prompt with Power shell in the menu when I right click the start button. Set to Off to get the command prompt option.
      My ComputerSystem Spec
  3.    05 May 2017 #3
    Join Date : Feb 2017
    Home
    Posts : 480
    Windows 10 Home x64, V1709 (16299.64)
    Thread Starter

    Hey, thanks for the comment. It is appreciated. I understand. I'm just trying to learn the coming changes and adapt to them. I do know "cmd" will still be available to be run from Powershell.
      My ComputersSystem Spec
  4.    05 May 2017 #4
    Join Date : Dec 2013
    Sydney, Nova Scotia, Canada
    Posts : 10,449
    Windows 10 IoT

    I had a feeling you'd say that. I'm a total powershell noob. So much so that I switch it back to command prompt out of habit.
      My ComputerSystem Spec
  5.    05 May 2017 #5
    Join Date : Feb 2017
    Home
    Posts : 480
    Windows 10 Home x64, V1709 (16299.64)
    Thread Starter

    So you know how I feel.
      My ComputersSystem Spec
  6.    05 May 2017 #6
    Join Date : Jul 2016
    Crewe Cheshire
    Posts : 1,466
    windows 10

    Tons of tutors on YouTube for PowerShell
      My ComputerSystem Spec
  7.    05 May 2017 #7
    Join Date : Sep 2014
    Nashville, TN
    Posts : 3,143
    Windows 10 Pro

    Quote Originally Posted by CWGilley View Post
    Hey, thanks for the comment. It is appreciated. I understand. I'm just trying to learn the coming changes and adapt to them. I do know "cmd" will still be available to be run from Powershell.
    You appear to have misunderstood what I said earlier. CMD shell is not going away. The only thing that's gone away is the "Open CMD shell" from the file menu of File Explorer. CMD is still in the start menu, and you do not have to run it from within powershell.

    The point I was making was that you could click File->Open Windows Powershell and then do many of the common things, or run cmd from within powershell. You can still run a standard cmd console by going to start and typing cmd and a regular cmd prompt will open. You can also pin that to start or taskbar if you want.

    In any event, after you add a path to your environment variables, you have to start a new console or powershell window.
      My ComputerSystem Spec
  8.    05 May 2017 #8
    Join Date : Feb 2017
    Home
    Posts : 480
    Windows 10 Home x64, V1709 (16299.64)
    Thread Starter

    Ah, I did misunderstand that one. You shouldn't scare old people like that.

    Quote Originally Posted by Mystere View Post
    ...In any event, after you add a path to your environment variables, you have to start a new console or powershell window.
    Hmmm. That path addition has been in place since right after I first booted this machine up.

    Humph! Something else I have to deal with. But I do have to admit it's entertaining and sometimes even a little fun.
      My ComputersSystem Spec
  9.    06 May 2017 #9
    Join Date : Mar 2015
    Sydney, NSW
    Posts : 93
    Windows 10

    Quote Originally Posted by CWGilley View Post
    It's been said that anything I can do from the Command Prompt, I can do in PS. Well I must have something wrong. Here's my setup now and none of my Batch Files or "little" programs run in PS:\
    ...
    How do I get the Utilities folder in a path that PS will read?
    CWGilley, could you elaborate?

    If I have a folder “C:\Utilities” in the path variable with batch and powershell scripts in it, I can specify just the name of the batch or powershell script in a powershell console and it will run. Is this what isn’t working for you?
      My ComputerSystem Spec
  10.    06 May 2017 #10
    Join Date : May 2017
    Posts : 3
    W10 Pro 1703

    SET PATH=C:\Utility;%PATH% should just work fine ( or using the GUI as you showed)
    Another trick is to always have your script go to the working directory, in my view mandatory ( did that also with Batch):
    $location = Split-Path ((Get-Variable MyInvocation -Scope 0).Value).MyCommand.Path
    Push-Location $location
    [Environment]::CurrentDirectory = $location
    <scriptcode>
    Pop-Location (if you have more lines below, make sure you are where you expect it.)

    Calling for scripts or apps, please read PowerShell and external commands done right // blog.edgylogic
    That one helped me A LOT!!!

    in my view ( and with the Batch experience of an old guy), Batch can do stuff with less code, normal OS things. But with conditions, functions (as we call them Procedures) and working with file-content, apps, Registry and what have you, I believe one has to start PS. So, chapeau for going there. There are indeed tons of info, have fun
      My ComputerSystem Spec

 
Page 1 of 3 123 LastLast


Similar Threads
Thread Forum
Windows 10 Education Pro
Hi sorry if this is the wrong forum, I read an article that states windows 10 pro users in education can upgrade to win10 pro education - Great I thought I registered on the business store applied for the free upgrade - the instructions for the...
Installation and Upgrade
Windows 10 Pro vs Education
So I recently discovered that I can get a copy of Windows 10 Education from my school for free, and I was wondering if that would be a good upgrade. I'm currently running Windows 10 Pro, but based on the few comparison tables I could find Education...
General Support
Windows 10 Education
I work two I.T. jobs. One of them is in a college I.T. department. So, naturally, when I heard about Windows 10 Education, I wanted to find out more. Mainly, the question that popped into my mind was, "Could this be a good system to upgrade to from...
General Support
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 07:59.
Find Us
Twitter Facebook Google+ Ten Forums iOS App Ten Forums Android App



Windows 10 Forums