Why do I get different outputs if I execute the following two commands in script and on the command line?
ps
dir
Is there an automatic pipe behaviour?
Here is the output from the two commands (outputs shortened):
PS C:\Users\Robzzz> ps
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
682 73 73040 62340 423 2,31 8464 iexplore
424 15 6332 6024 62 884 svchost
PS C:\Users\Robzzz> dir
Mode LastWriteTime Length Name
---- ------------- ------ ----
d-r-- 23.09.2013 09:24 Contacts
d-r-- 03.12.2013 15:30 Desktop
Here is the output from the script (outputs shortened):
PS C:\Users\Robzzz> .\psdir.ps1
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
------- ------ ----- ----- ----- ------ -- -----------
682 73 73040 62340 423 2,31 8464 iexplore
424 15 6332 6024 62 884 svchost
PSPath : Microsoft.PowerShell.Core\FileSystem::C:\Users\Robzzz\Contacts
PSParentPath : Microsoft.PowerShell.Core\FileSystem::C:\Users\Robzzz
PSChildName : Contacts
PSDrive : C
PSProvider : Microsoft.PowerShell.Core\FileSystem
PSIsContainer : True
Name : Contacts
Parent : Robzzz
Exists : True
Root : C:\
FullName : C:\Users\Robzzz\Contacts
Extension :
CreationTime : 02.01.2012 09:38:38
CreationTimeUtc : 02.01.2012 08:38:38
LastAccessTime : 02.01.2012 09:38:38
LastAccessTimeUtc : 02.01.2012 08:38:38
LastWriteTime : 23.09.2013 09:24:09
LastWriteTimeUtc : 23.09.2013 07:24:09
Attributes : ReadOnly, Directory
BaseName : Contacts
Mode : d-r--
PSPath : Microsoft.PowerShell.Core\FileSystem::C:\Users\Robzzz\Desktop
PSParentPath : Microsoft.PowerShell.Core\FileSystem::C:\Users\Robzzz
PSChildName : Desktop
PSDrive : C
PSProvider : Microsoft.PowerShell.Core\FileSystem
PSIsContainer : True
Name : Desktop
Parent : Robzzz
Exists : True
Root : C:\
FullName : C:\Users\Robzzz\Desktop
Extension :
CreationTime : 02.01.2012 09:36:02
CreationTimeUtc : 02.01.2012 08:36:02
LastAccessTime : 03.12.2013 15:30:08
LastAccessTimeUtc : 03.12.2013 14:30:08
LastWriteTime : 03.12.2013 15:30:08
LastWriteTimeUtc : 03.12.2013 14:30:08
Attributes : ReadOnly, Directory
BaseName : Desktop
Mode : d-r--