PowerShell Convert Path for the win!

preview_player
Показать описание
In this video, we look at how to use Convert-Path in the context of a problem I was having with one of my scripts. We first look at the problem, the terrible way I solved it, and finally how to solve the issue properly. Fun times.

Cmdlets we cover:
* Convert-Path
* Replace
* SubString

Video on installing PowerShell Strings

Рекомендации по теме
Комментарии
Автор

boring....but often overlooked! Great video, keep 'em coming!

davidsonmg
Автор

Thank you very much Mr.Shane, do you have video for change file and folder NTFS permession on windows using powershell ?

marwanabuali
Автор

Hey Shane hooe ur doing well
Want to know how is the > changing to red when it senses an incomplete command

alokrathore
Автор

you could just use the .Tolower() or ToUpper() methods on the input of the user ..

peronnikbeijer
Автор

Cmdlet Convert-Path can easy convert any indirect path into an absolute path value. It can event conver unix slashes into windows backslashes. It can convert disk drive letter to uppercase, just like it is in the result of Get-PSDrive. But it has one small shortage. When you give as a parameter a path, using case different from the original, e.g. c:\users\adam, then result is C:\users\adam. This is incorrect, it should be (on my system) C:\Users\Adam. Generally, any part of the path present in Convert-Path parameter (except drive letter) is not converted to correct case. It is used without change. It is possible to make a simple function to fil this gap...

adamkaminski
Автор

Hi Shane, do you have a video for creating office 365 distribution lists in mass?

NancyRileyNuniverse
Автор

There should be videos on all those other ways as well :D

WittAllen
Автор

$LowerPath.replace($LowerPath.Substring(0, 2), $Lowerpath.Substring(0, 1).ToUpper()+":")

Just a thought, instead of above line, you could also use this, right? that would make this bit simpler.

$LowerPath.replace($LowerPath.Substring(0, 1), $Lowerpath.Substring(0, 1).ToUpper())

dinesh