Windows 10

Powershell 5


Powershell 5 is expected to be released with Windows 10. It’s currently (April 2015) in preview. It’s backward compatible with Windows 8, 8.1, 2012, and 2012 R2. To get PS5 install WMF5 from this link. Here’s the general PowershellGet architecture:

2677.1.png-550x0

For more information see the Powershell Gallery. PS5 installation requires a reboot

PS5-01After a reboot, in Powershell ISE, PS version shows as version 5

$PSVersionTable

PS5-02PS5 comes with PowershellGet module. To see its commands:

Get-Command -Module PowerShellGet

PS5-03

When running for the first time, run this command to automate the download of the needed nuget-anycpu.exe

Get-PackageProvider -Name NuGet -ForceBootstrap

PS5-04The default Repository is the Powershell Gallery, and it’s untrusted by default:

PS5-05To check out currently available modules:

$Modules = Find-Module
$Modules.Count # 153
$Modules | sort name | select * | Out-GridView

To install a module from the Gallery, use Install-Module as in:

Install-Module Pester

PS5-06Since the Powershell Gallery is untrusted by default, we’ll get the message above. If you want to trust the Powershell Gallery, use:

Set-PSRepository -Name PSGallery -InstallationPolicy Trusted

Alternatively, use the -Force parameter with the Install-Module command to avoid the untrusted repository prompt.

Pester is a great unit testing module to help test Powershell scripts, developed by David Wyatt and the Pester team. To see its commands:

Get-Command -Module Pester

For more information on Pester see Pester on GitHub and video presentation from Powershell Summit NA 2015.

Now I have this module and can use its commands.

One of the great benefits of a NuGet repository for PS modules like PowershellGet is version control, as it keeps track of module versions as they’re published. To see different versions of a module:

Find-Module -Name Pester -AllVersions | select version,PublishedDate  | FT -a

PS5-07

 

 

 

 

 

 

 

 

Advertisements

DOT NET 3.5 for Windows 10 Technical Preview


DOT NET 3.5 was often hard to install on Windows 8, 8.1, 2012, and 2012 R2. I tested installing it on Windows 10 Technical Preview for Enterprise:

Win10e40

In Control Panel\Programs\Programs and Features, click turn Windows features on or off, and check the “.NET Framework 3.5” box and click OK

Win10e41

Click “Download files from Windows Update”

Win10e42

 

Win10e43

 

Win10e44

It just works!

Same can be done via the DISM command line utility:

DISM /Online /Enable-Feature /FeatureName:NetFx3 /All

Win10e47

Again it works just fine!


Using SysPrep with Windows 10 Technical Preview for Enterprise


SysPrep.exe is a tool located under c:\windows\system32\SysPrep folder. It can be used to “generalize” a Windows installation to be used for automated deployment instead of doing every fresh install from the ISO media.

After doing a fresh install of Windows 10 Technical Preview for Enterprise as a Gen 2 VM on Server 2012 R2 Hyper-V host, I ran Windows updates, enabled Remote Desktop, installed 2 Windows updates updates, rebooted, installed RSAT, then I ran SysPrep.exe

Win10e30

I chose to “Generalize” and “Shutdown”, so that I can copy the VM’s VHDX file to be used for other Windows 10 Technical Preview machine deployments.

Sysprep will prepare the system and shutdown the computer.

After copying the VHDX file, I restarted the VM:

Win10e34

Set Region and Language, accept license agreement, skip product key:

Win10e35

 

Although the product key was skipped, later on after the machine was setup and rebooted, Windows auto-activated. No need to enter a product key or manually activate:

Win10e39

Windows 10 Technical Preview and Windows 10 Technical Preview for Enterprise license expires April 15, 2015.

Enter a user name and password:

Win10e36

Notes:

  • Do NOT join the domain prior to running Sysprep. It will fail with “Fatal error” similar to this: Win10e32
  • Currently Sysprep does not let you use a local account that was setup prior to running SysPrep. You will have to setup another local account when using the SysPrep’d image
  • Local Administrator account is disabled by default on Windows 10 Technical Preview

 


Remote Server Administration Tools (RSAT) for Windows 10 Technical Preview


Remote Server Administration Tools (RSAT) for Windows 10 Technical Preview are now available for download. Download and install the version that matches your Windows 10 installation (x86 or x64)

Win10e29

I wanted to know what Powershell modules this will add to a fresh Windows 10 Technical Preview for Enterprise. So I used this short script:

Win10e27

Get-Module -ListAvailable | 
 Select name,version,ModuleType,ClrVersion,PowershellVersion | 
 Export-Csv .\Win10b-modules.csv -NoTypeInformation

# Install RSAT tools for Windows 10 Technical Preview
# http://www.microsoft.com/en-us/download/details.aspx?id=44280
.\WindowsTH-KB2693643-x64.msu

Get-Module -ListAvailable | 
 Select name,version,ModuleType,ClrVersion,PowershellVersion | 
 Export-Csv .\Win10c-modules.csv -NoTypeInformation

Compare-Object -ReferenceObject (Import-Csv .\Win10b-modules.csv).name `
 -DifferenceObject (Import-Csv .\Win10c-modules.csv).name

The first 3 lines save a list of the installed PS modules in a CSV file.

Next I installed RSAT:

Win10e25

then accepted the license agreement.

Win10e26

Installation finished successfully. This added shortcuts to Server Manager tool (c:\windows\system32\ServerManager.exe) on the start menu and under All Apps

Win10e28

A comparison of the PS module before and after the installation showed that RSAT added the following 19 modules:

ActiveDirectory
ClusterAwareUpdating
DFSN
DFSR
DhcpServer
DnsServer
FailoverClusters
GroupPolicy
IpamServer
IscsiTarget
NetworkController
NetworkLoadBalancingClusters
NFS
RemoteDesktop
ServerManager
ServerManagerTasks
StorageQoS
UpdateServices
WVR

If you encounter errors with Sysprep see this KB article. It’s for Windows 8 but it applies to Windows 10 Technical Preview as well.


1/8/2015 – Window Technical Preview build 9879:

Some may have access to the new Windows Technical Preview build 9879 available in the MSDN subscription secure download site.

RSAT8

 

I’ve done a fresh install of Windows Technical Preview build 9879, and attempted to install RSAT normally. That just worked:

RSAT10

In another fresh install of WinTP 9879 I tried using DISM:

RSAT11

That completed successfully as well.

Some have reported errors attempting to install RSAT for Windows TP. I’ve downloaded the latest Windows TP ISO and did a fresh install as a Gen 2 virtual machine on Hyper-V 2012 R2. I downloaded and installed RSAT without any issue. I wan not able to replicate the problem. However, here’s another way to try to install it:

Download the WindowsTH-KB2693643-x64.msu file as usual – save it to the default location under ‘downloads’

Run the following script in Powershell_ISE (as administrator – elevated permissions)

RSAT6

$Path = "$env:USERPROFILE\downloads\WindowsTH-KB2693643-x64.msu"
# Exctract .cab file
$Target = "$env:USERPROFILE\downloads\RSAT"
wusa.exe $Path /extract:$Target
# Install via DISM
$CAB = "$env:USERPROFILE\downloads\RSAT\WindowsTH-KB2693643-x64.cab"
Dism.exe /Online /Add-Package /PackagePath:$CAB

 

 


Windows 10 Technical Preview for Enterprise updates


On 10/2/2014 I ran Windows Updates on a plain vanilla installation of Windows 10  Technical Preview for Enterprise. It found 1 update:

Win10e17

I installed, and rebooted

Win10e23

It took a little longer than expected for a Gen 2 VM. After reboot, I looked for installed updates, and found 2 (!):

Win10e24

The first update is KB3001512 which addresses these issues:

  • In Windows Technical Preview, certain devices do not receive firmware or driver updates.
  • Adobe Flash update does not contain premium video playback.
  • Some problems in the Compatibility View list for Internet Explorer 11

The second update is KB3002675. Powershell shows that its information link is http://support.microsoft.com/?kbid=3002675 but this seems to be a broken link at this time..

Win10e22


Windows 10 Technical Preview – Hyper-V Integration


After installing Windows 10 Technical Preview on Windows Server 2012 R2, I checked the integration service. In Hyper-V Manager on the 2012 R2 host, all looked normal:

Win10a29

Running the following Powershell command on the 2012 R2 Hyper-V server showed that the Windows 10 Technical Preview VM comes with Integration Service version 6.4.9841

Win10a28

 

This command shows more details:

Win10a30

Running this comparison between Integration services for the this Windows 10 VM and a Server 2012 R2 VM:

Compare-Object -ReferenceObject (Get-VMIntegrationService -VMName v-Win10a | select *) -DifferenceObject (Get-VMIntegrationService -VMName v-2012R2-G2a | select *)

showed no difference (This does not show or compare integration service version.)


Windows 10 Technical Preview – early look at Windows components and features


Checking versions of different Windows components in Windows 10 Technical Preview:

It comes with Powershell 5 !!

Win10a25

Looking at the OS version, it is version 6.4.9841.0

Win10a26This is shown from WMI, and on file versions, and help/about:

Win10a27

 

Navigation is almost identical to Windows 8.1/Server 2012 R2, which I find very comforting.

Checking the available Powershell modules with the command:

Get-Module -ListAvailable | 
    Select name,version,ModuleType,ClrVersion,PowershellVersion | 
        Export-Csv .\Win10-modules.csv -NoTypeInformation

Shows the following 62 modules:

Name Version ModuleType ClrVersion PowerShellVersion
AppBackgroundTask 1.0.0.0 Manifest 3
AppLocker 2.0.0.0 Manifest 4 3
Appx 2.0.0.0 Manifest 4 3
AssignedAccess 1.0.0.0 Script
BitLocker 1.0.0.0 Manifest 4 3
BitsTransfer 2.0.0.0 Manifest 4 3
BranchCache 1.0.0.0 Manifest 3
CimCmdlets 1.0.0.0 Manifest 4 3
Defender 1 Manifest 3
DirectAccessClientComponents 1.0.0.0 Manifest 3
Dism 3 Script 4 4
DnsClient 1.0.0.0 Manifest 4 3
International 2.0.0.0 Manifest 4 3
iSCSI 1.0.0.0 Manifest 3
ISE 1.0.0.0 Script 4 3
Kds 1.0.0.0 Manifest 4 3
Microsoft.PowerShell.Archive 1.0.0.0 Manifest
Microsoft.PowerShell.Diagnostics 3.0.0.0 Manifest 4 3
Microsoft.PowerShell.Host 3.0.0.0 Manifest 4 3
Microsoft.PowerShell.Management 3.1.0.0 Manifest 4 3
Microsoft.PowerShell.ODataUtils 1 Script
Microsoft.PowerShell.Security 3.0.0.0 Manifest 4 3
Microsoft.PowerShell.Utility 3.1.0.0 Manifest 4 3
Microsoft.WSMan.Management 3.0.0.0 Manifest 4 3
MMAgent 1 Manifest 3
MsDtc 1.0.0.0 Manifest 4 3
NetAdapter 2.0.0.0 Manifest 3
NetConnection 1.0.0.0 Manifest 3
NetEventPacketCapture 1.0.0.0 Manifest 3
NetLbfo 2.0.0.0 Manifest 3
NetNat 1.0.0.0 Manifest 3
NetQos 2.0.0.0 Manifest 3
NetSecurity 2.0.0.0 Manifest 4 3
NetSwitchTeam 1.0.0.0 Manifest 3
NetTCPIP 1.0.0.0 Manifest 3
NetworkConnectivityStatus 1.0.0.0 Manifest 3
NetworkSwitch 1.0.0.0 Script 3
NetworkTransition 1.0.0.0 Manifest 3
OneGet 1.0.0.0 Binary 4 2
PcsvDevice 1.0.0.0 Manifest 3
PKI 1.0.0.0 Manifest 4 3
PowerShellGet 0.5 Script 3
PrintManagement 1.1 Manifest 3
PSDesiredStateConfiguration 1 Manifest
PSDiagnostics 1.0.0.0 Script 2.0.50727 2
PSScheduledJob 1.1.0.0 Binary 4 3
PSWorkflow 2.0.0.0 Manifest 4 3
PSWorkflowUtility 1.0.0.0 Manifest 4 3
ScheduledTasks 1.0.0.0 Manifest 4 3
SecureBoot 2.0.0.0 Manifest 4 3
SmbShare 2.0.0.0 Manifest 3
SmbWitness 2.0.0.0 Manifest 3
StartScreen 1.0.0.0 Manifest 4 3
Storage 2.0.0.0 Manifest 3
TLS 2.0.0.0 Manifest 4 3
TroubleshootingPack 1.0.0.0 Manifest 4 3
TrustedPlatformModule 2.0.0.0 Manifest 4 3
VpnClient 2.0.0.0 Manifest 3
Wdac 1.0.0.0 Manifest 3
WindowsDeveloperLicense 1.0.0.0 Manifest 4 3
WindowsErrorReporting 1 Script 4 3
WindowsSearch 1.0.0.0 Manifest 4 3

I ran the same command on a Windows 2012 R2 server (that has Powershell 4) and ran a comparison:

Compare-Object -ReferenceObject (Import-Csv .\Win8-modules.csv).name `
-DifferenceObject (Import-Csv .\Win10-modules.csv).name

That showed the following 8 new modules:

AppBackgroundTask 
AssignedAccess 
Defender 
Microsoft.PowerShell.Archive 
Microsoft.PowerShell.ODataUtils 
NetworkSwitch 
OneGet 
PowerShellGet 

See this blog post for more details on new PS5 modules..

This blog post lists new features in Powershell 5


Windows 10 Technical Preview – early look at the user interface


Just installed Windows 10 Technical Preview as a Gen 2 VM on Server 2012 R2 Hyper-V. Here’s what we know:

It comes with IE 11:

Win10a13

 

The start menu looks like a combo of Windows 7 and Windows 8 tile:

Win10a14

 

I pinned the Powershell icons to the task bar, they were not there before..

Clicking on the logged on name on top bring up 3 options:

Win10a15

 

Trying the “Change account picture”:

Win10a16

 

I browsed to a picture and selected it. The browse dialog box defaulted to the Pictures folder:

Win10a19

The Lock option worked as expected:

Win10a17

By default it brought on the on screen keyboard..

The Sign out option had an error:

Win10a18Sign out anyway option worked, and I was signed out.


If you click All Apps at the bottom of the start menu you see:

Win10a20

Trying the search field:

Win10a21

I clicked Computer Management link on top expecting to get this:

Win10a24

but instead I got a Bing search:

Win10a22

I was able to get to the Computer Management tool via right-clicking on “This PC” in File Explorer and choosing Manage:

Win10a23

It seems anything you search for in the “Search Anywhere” box simply brings a Bing search..

See this link for information on how to switch between the Windows 7 style start menu and the Windows 8 style start screen (tiles)


Installing Windows 10 Technical Preview as Gen 2 VM on Hyper-V 2012 R2


win10Microsoft released Windows 10 Technical Preview today 10/1/2014 shortly after noon time. Here’s how the installation went:

Media: ISO file:

Win10e20

Setup: Gen 2 VM on Server 2012 R2 hypevisor, 50 GB disk, mounted the iso, 2 GB startup dynamic RAM, 1 GB minimum, 8 GB maximum, 4 cores.

Win10a01

After a reboot, this screen came up:

Win10a02I clicked Settings:

Win10a03

And, of course, I clicked “Customize”

Win10a04

I went with “Yes”

Win10a05

These are the default settings. For this test, I’m accepting all defaults

Win10a06

I’m pleasantly surprised that these are the defaults!

Win10a07

I did not like those much..

Win10a08 The familiar “Checking your Internet connection” message

Win10a09

I had DHCP turned off on the network, so the VM did not pick up an IP address and could not connect to the Internet automatically. This is what I wanted. So, I clicked “Create a local account”

Win10a10

A Password hint is required.

Win10a11

and the familiar “Finalizing your settings” message..

and the desktop appeared. Installation is complete!

No key or license was needed.

That was quick and painless. No crash, no blue screen, no surprise. So far so good!!

I entered an IP address and was connected to the network and the Internet:

Win10a12

 

And the OS version was:

Win10e21


10/2/2014:

I got a copy of the ISO for Windows 10 Technical Preview for Enterprise:

Win10e18

Installation was identical to the above. I cannot see any differences from the version above. Both seem to be the Client OS version of Windows 10

Win10e19