Windows 10: I Need Some Powershell Education Solved

Page 1 of 3 123 LastLast
  1. Wiley Coyote's Avatar
    Posts : 849
    Windows 10 Home x64 Version 1803 (OS Build 17134.285)
       05 May 2017 #1

    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

    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. Wiley Coyote's Avatar
    Posts : 849
    Windows 10 Home x64 Version 1803 (OS Build 17134.285)
    Thread Starter
       05 May 2017 #3

    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

    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. Wiley Coyote's Avatar
    Posts : 849
    Windows 10 Home x64 Version 1803 (OS Build 17134.285)
    Thread Starter
       05 May 2017 #5

    So you know how I feel.
      My ComputersSystem Spec

  6.    05 May 2017 #6

    Tons of tutors on YouTube for PowerShell
      My ComputerSystem Spec

  7.    05 May 2017 #7

    CWGilley said: 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. Wiley Coyote's Avatar
    Posts : 849
    Windows 10 Home x64 Version 1803 (OS Build 17134.285)
    Thread Starter
       05 May 2017 #8

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

    Mystere said: 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. Posts : 93
    Windows 10
       06 May 2017 #9

    CWGilley said: 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

    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

Related Threads
Windows 10 Education Pro in Installation and Upgrade
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...
Windows 10 Pro vs Education in General Support
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...
Windows 10 Education in General Support
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...
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 13:41.
Find Us