#powershell Always Up-to-date Hardware Inventory (Windows)

#requires -version 3.0
###############################################################################
# Copyright (c) 201x-2018 leedesmond.com
# All Rights Reserved. Use at your own risk and responsibility.
# Version 1.00
#
# Any Windows Server – Always Up-to-date Hardware Inventory (Core)
#
# REQUIREMENTS: PowerShell Remoting enabled on target hosts & firewall
# ports (WMI calls)
###############################################################################
Continue reading

#skype4b #powershell Always Up-to-date Infrastructure Inventory (Topology)

#requires -version 3.0
###############################################################################
# Copyright (c) 201x-2018 leedesmond.com
# All Rights Reserved. Use at your own risk and responsibility.
# Version 1.00
#
# Skype for Business Server – Always Up-to-date Inventory (Topology)
# Gathers core #skype4b infrastructure inventory (topology), supporting
# server roles, file stores and SQL backend databases.
#
# NOTE – change SiteId where appropriate
###############################################################################
Continue reading

#powershell Get List of Two-letter Country ISO 3166 Code (alpha-2), Currency, Language and more

#requires -version 3.0
################################################################################
# Copyright (c) 201x-2018 leedesmond.com
# All Rights Reserved. Use at your own risk and responsibility.
# Version 1.00
#
################################################################################
#
$AllCultures = [System.Globalization.CultureInfo]::
GetCultures(
[System.Globalization.CultureTypes]::
SpecificCultures) # !AllCultures
Continue reading

#WindowsServer2016 Build 1709 (Server Core) Enable Remote Management

Except for a few control panel applets (and dialog boxes), Windows Server 2016 Build 1709 runs exclusively in Server Core text mode. This means that familiar graphical user tools are not available whether you sign-in right in front of the machine or connect from a distance over Remote Desktop.

Basic configuration such as domain/workgroup membership, computer name and network settings, etc. can be realized using the provided VB Script in the form of %windir%\system32\sconfig.cmd. Nevertheless, you can continue to use common GUI MMC legacy tools such as Event Viewer or services.msc to remotely connect to a Windows Server 2016 Build 1709 box.

Since Windows Server 2012 R2, PowerShell remoting is activated out-of-the-box, a feature which is dependent on Windows Remote Management (WinRM). This is what Server Manager relies on primarily to remotely manage Windows Server 2012 and higher versions. Server Manager remote administration of previous Windows Server versions continue to work over Distributed Component Object Model (DCOM)*.

Consequently, setting “4) Configure Remote Management” to “1) Enable Remote Management” via sconfig.cmd is only part of the story (WinRM portion). Continue reading

#skype4b #powershell *-CsDatabase Common Error Messages (and Fix) II

Running Test-CsDatabase can produce different output for ExpectedVersion and InstalledVersion against one or more backend SQL databases in your Skype for Business Server infrastructure. Depending on the host where this cmdlet is executed, Continue reading

#pscore6 v.s. #powershell 5.x Modules (Part III)

You must have already noticed discrepancies in modules and corresponding commands[1] between PowerShell versions and releases. How can I keep abreast with constant changes in today’s ever fast-pace cloud technologies now that PowerShell is cross-platform commencing with version 6.x?

One way to find out yourself is illustrated here, paying attention to compare apples to apples i.e. Windows Desktop v.s. Windows Desktop. Otherwise, a big difference is to be expected between Windows Server 2016 and Windows 10 Desktop platforms running PowerShell 5.1.x for instance. Continue reading

#pscore6 v.s. #powershell 5.x Modules (Part II)

In the default installation of PowerShell Core 6.0 and Windows PowerShell 5.10 (PS5) with 13 and 89 modules discovered respectively, both PS versions have overlapping module names as illustrated:

CimCmdlets
Microsoft.PowerShell.Archive
Microsoft.PowerShell.Diagnostics
Microsoft.PowerShell.Host
Microsoft.PowerShell.Management
Microsoft.PowerShell.Security
Microsoft.PowerShell.Utility
Microsoft.WSMan.Management
PackageManagement
PowerShellGet
PSDesiredStateConfiguration
PSDiagnostics
PSReadline

An output with similar module names does not always mean that the number and type of commands in each of these modules correspond (see Part I of this blog series). Continue reading

#pscore6 v.s. #powershell 5.x Modules

Because of the cross-platform heterogeneous support design goal in #PsCore6, many platform specific #powershell functionality on the Windows operating system simply cannot, may not or have not yet been migrated over. Since Microsoft does not always fully document details of changes across product versions, this series of blog posts will attempt to identify any similarities and differences between these two PowerShell editions from the command perspective in a typical deployment, namely that of Windows PowerShell 5.x and the newly Release to Manufacturing/Web (RTM/RTW) GA version of PowerShell Core 6.0.0.

Let us kick start with the topic of Modules where the key functionality of PowerShell resides. Out of the box, executing powershell.exe (<= PS5.1) and pwsh.exe (PSCore6) will load a basic set of commands from core modules with exactly the same names:

ModuleType Version Name
———- ——- —-
Manifest 3.1.0.0 Microsoft.PowerShell.Utility
Script 1.2 PSReadline

Even though module names and versions carry the same information, Continue reading

#powershell v6.0 RTM GA Generally Available and Supported

PowerShell Core 6.0.0

  • a new edition of PowerShell #PsCore6
  • built on top of .NET Core “CoreCLR”
  • cross-platform support from Windows, macOS to Linux (direct download)
  • community driven (GitHub) and open-source
  • built for heterogeneous environments and the hybrid cloud
  • works side-by-side with Windows PowerShell[1] (3.0 and later)
  • $PSVersionTable.PSEdition is set to Core
  • process runs as pwsh(.exe) c.f. Windows Powershell = powershell(.exe)
  • default installation path %programfiles%\PowerShell\
  • starts as Administrator in %programfiles%\PowerShell\6.0.0
  • new user profile path $profile = %userprofile%\Documents\PowerShell
  • different $env:PSModulePath
  • not available features – workflow, WMI[2],  Windows Presentation Foundation/Windows Forms, PowerShell ISE[3]
  • Update-Help -force -UICulture “en-us” (help system independent of Windows Powershell)
  • Windows PowerShell 5.10
    = “maintenance” mode
    =  last Windows client/server version i.e.  no new version planned

[1] built on top of .NET Framework 4.x “FullCLR”
[2] use the equivalent *-CIM* cmdlets
[3] use Visual Studio Code + PowerShell plugin

REFERENCES

  1. PowerShell Core 6.0: Generally Available (GA) and Supported!
  2. PowerShell 6.0 Roadmap: CoreCLR, Backwards Compatibility, and More!
  3. Angel Calvo (Twitter): Announcing the GA & Enterprise supported version of #PowerShell Core 6!
  4. Announcing PowerShell for Visual Studio Code 1.0!
  5. What’s New in PowerShell Core 6.0
  6. PowerShell Core Support Lifecycle
  7. PowerShell documentation (en-us)