Friday, January 23, 2009

Under Windows 7.7000

[] Windows PowerShell w/ windows 7 ...

Powershell.exe is being installed in %windir%\ system32\ windowspowershell\ v1.0. The prompt shows: 'Windows PowerShell V2' on the first line; 'Copyright (C) 2008 Microsoft Corporation. All rights reserved.' on the second line. The Screen Background and Screen Text uses white on black, same as that of cmd.exe, when the V2CTP3 uses gray on blue black.

PS C:\stub> $PSVersionTable

Name Value
---- -----
CLRVersion 2.0.50727.3521
BuildVersion 6.1.7000.0
PSVersion 2.0
PSCompatibleVersions {1.0, 2.0}

PS C:\stub> [environment]::OSversion | fl

Platform : Win32NT
ServicePack :
Version : 6.1.7000.0
VersionString : Microsoft Windows NT 6.1.7000.0

There is an extra module called TroubleshootingPack in Windows 7 but not in V2CTP3.

Its WindowsPowerShellHelp.chm, file size was 1,560,143 bytes (in Windows 7) released one month later than V2CTP3 (1,604,819 bytes). About_Associative_Array help section is similar to cmdlet head section but different help layout; this is not available in V2CTP3. Another was About_Globbing help section.

Just as V2CTP3 released before Christmas Day in 2008, the powershell_ise.exe was 196,608 bytes (filesize), which was released two days later than Windows 7's (192,512 bytes). Such feature is found in Home Basic Edition too.

[] Microsoft.NET Framework 3.5.1 w/ windows 7...

The web browser version shows: 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0)'.

The following shows what CSC.exe has:

C:\Windows\Microsoft.NET\Framework\v2.0.50727>csc
Microsoft (R) Visual C# 2005 Compiler version 8.00.50727.3521
for Microsoft (R) Windows (R) 2005 Framework version 2.0.50727
Copyright (C) Microsoft Corporation 2001-2005. All rights reserved.

C:\Windows\Microsoft.NET\Framework\v3.5>csc
Microsoft (R) Visual C# 2008 Compiler version 3.5.30729.715
for Microsoft (R) .NET Framework version 3.5
Copyright (C) Microsoft Corporation. All rights reserved.

[] NT Services w/ windows 7 ...

The following services that are automatically started when Windows is up running:

Background Intelligent Transfer Service, Base Filtering System, COM+ Event System, Cryptographic Services, DCOM Server Process Launcher, Desktop Window Manager Session Manager, DHCP Client, Diagnostic Policy Service, Distributed Link Tracking Client, DNS Client, Group Policy Client, IKE and AuthIP IPsec Keying Modules, IP Helper, Network Location Awareness, Network Store Interface Service, Offline Files, Plug and Play, Power, Print Spooler, Remote Procedure Call, Security Accounts Manager, Security Center, Server, Shell Hardware Detection, Software Protection, Superfetch, System Event Notification Service, Task Scheduler, TCP/IP NetBIOS Helper, Themes, User Profile Service, Windows Audio, Windows Audio Endpoint Builder, Windows Defender, Windows Driver Foundation, Windows Event Log, Windows Firewall, Windows Management Instrumentation, Windows Search, Windows Update, Workstation.

The following shown here whose services are manually started:

Application Experience, Diagnostic Service Host, Diagnostic System Host, Function Discovery Provider Host, Function Discovery Resource Publicatioin, HomeGroup Provider, Network Connections, Network List Service, Portable Device Enumerator Service, Program Compatibility Assistant Service, SSDP Discovery.

The following services are disabled:

Internet Connection Sharing, Net.Tcp Port Sharing Service, Routing and Remote Access, Windows Media Center Extender Service, Windows Media Center Service Launcher.

The rest of them whose Startup Type is set to Manual:

Adaptive Brightness, AppID Service, Application Information, Application Layer Gateway Service, Application Management, BitLocker Drive Encryption Service, Block Level Backup Engine Service, Bluetooth Support Service, BranchCache, Certificate Propagation, CNG Key Isolation, COM+ System Application, Credential Manager Service, Disk Defragmenter, Distributed Transaction Coordinator, Encrypting File System, Extensible Authentication Protocol, Fax, Health Key and Certificate Management, HomeGroup Listener, Human Interface Device Access, Interactive Services Detection, KtmRm for DTC, Link-Layer Topology Discovery Mapper, Microsoft .NET Framework NGEN, Microsoft iSCSI Initiator Service, Microsoft Software Shadow Copy Provider, Netlogon, Network Access Protection Agent, Parental Controls, Peer Name Resolution Protocol, Peer Networking Grouping, Peer Networking Identity Manager, Performance Logs & Alerts, PnP-X IP Bus Enumerator, PNRP Machine Name Publication Service, Pong Service for Wireless USB, Problem Reports and Solutions Control Panel Support, Protected Storage, Quality Windows Audio Video Experience, Remote Access Auto Connection Manager, Remote Access Connection Manager, Remote Desktop Services, Remote Desktop Services Configuration, Remote Desktop Services UserMode Port Redirector, Remote Procedure Call Locator, Remote Registry, Secondary Logon, Secure Socket Tunneling Protocol Service, Sensors MTP Monitor Service, Smart Card, Smart Card Removal Policy, SNMP Trap, SPP Notification Service, Tablet PC Input Service, Telephony, Thread Ordering Server, UPnP Device Host, Virtual Disk, Volume Shadow Copy, WebClient, Windows Backup, Windows Biometric Service, Windows CardSpace, Windows Color System, Windows Connect Now, Windows Error Reporting Service, Windows Event Collector, Windows Font Cache Service, Windows Image Acquisition, Windows Installer, Windows Media Center Receiver Service, Windows Media Center Scheduler Service, Windows Media Player Network Sharing Service, Windows Modules Installer, Windows Presentation Foundation Font Cache 3.0.0.0, Windows Remote Management, Windows Time, WinHTTP Web Proxy Auto-Discovery Service, Wired AutoConfig, WLAN AutoConfig, WMI Performance Adapter, WWAN AutoConfig.

These are services that are new to me:-

Adaptive Brightness properties are:
Service name: SensrSvc
Description: Monitors ambient light sensors to detect changes in ambient light and adjust the display brightness.

AppID Service properties are:
Service name: AppIDSvc
Description: Disabling this service will prevent Application Control Policies from being enforced.

Block Level Backup Engine Service properties are:
Service name: wbengine
Description: The WBENGINE service is used by Windows Backup to perform backup and recovery operations. If this service is stopped by user, it may cause the currently running backup or recovery operation to fail. Disabling this service may disable backup and recovery operations using Windows backup on this machine.

BranchCache properties are:
Service name: PeerDistSvc
Description: This service caches network content from peers on the local subnet.

HomeGroup Listener properties are:
Service name: HomeGroupListener
Description: Makes local computer changes associated with configuration and maintenance of the homegroup-joined computer.

HomeGroup Provider properties are:
Service name: HomeGroupProvider
Description: Performs networking tasks associated with configuration and maintenance of homegroups.

Pong Service for Wireless USB properties are:
Service name: PngSvc
Description: The PngSvc service hosts the cable based association module for Wireless USB devices. Cable association involves establishing trust between a Wireless USB device and host by exchanging a secret key over a USB cable.

Windows Biometric Service properties are:
Service name: WbioSrvc
Description: The Windows biometric service gives client applications the ability to capture, compare, manipulate, and store biometric data without gaining direct access to any biometric hardware or samples. The service is hosted in a privileged SVCHOST process.

WWAN AutoConfig properties are:
Service name: WwanSvc
Description: This service manages mobile broadband (GSM & CDMA) data card/embedded module adapters and connections by auto-configuring the networks. It is strongly recommended that this service be kept running for best user experience of mobile broadband devices.

[] Windows Features w/ windows 7 ...

Available features are as follows:

ActiveX Installer Service
Games
Indexing Service
Internet Information Services
Internet Information Services Hostable Web Core
Microsoft .NET Framework 3.5.1 <--- new
Microsoft Message Queue Server
Printing and Document Services
Ras CMAK feature
Remote Differential Compression
RIP Listener
Services for NFS
Simple Network Management Protocol
Simple TCPIP services
Subsystem for UNIX-based Applications
Tablet PC Components
Telnet Client
Telnet Server
TFTP Client
Windows Gadget Platform <--- new
Windows OCR
Windows Process Activation Service
XPS

[] Test Lab w/ Windows 7 ...

Using VMware 6.0.2 to run Windows 7 beta was best way to test the latest operating system.

The OSVersionInfo that I has got here:-
Major Version: 6
Minor Version: 1
Build number: 7000
BuildLabs: 7000 winmain_win7beta 081212-1400
EULAID: Win7_B.1_PRO_NRL_en-US
DVD ISO: 2.47GB
Shift-F10 during installation: Microsoft Windows [6.1.7000]
Windows Media Player: 12.0.7000.7000

Disk Management Layout:-

Disk 0 #1 200MB NTFS
marked as 'Active, System, Primary Partition'
has no drive letter

Disk 0 #2 19.80GB NTFS
marked as 'Boot, Page File, Crash Dump, Primary Partition'
has drive letter (C:)

To remove the 'Send Feedback' at top right of dialog, HKCU\ Control Panel\ Desktop\ FeedbackToolEnabled (DWORD), changed from its default value of '3' to '0'.

Phew!

Thursday, January 22, 2009

building a Zoo Tycoon

Way back in the year 2003, I bought a complete set of Zoo Tycoon and am still enjoying playing it. It expands one's creativity by matching and mixing different zoo animals, marine animals and the most interesting, is the dinosaurs! Each scenario earns zoo rating and donations from the guests. My target goes as high as 90% zoo rating when there are more exhibits especially for good mixtures of animals. For example, hippotamus with flamingo, and ostrich family consists of common wildbeest, and thomson gazelle. Sell away their babies each few months to earn extras. Twice the 8x8 exhibits for Africa buffalo for ten members surrounded with tall grasses and small rocks. They are savannah animals which are easily tended by zookeepers.

There are few scenarios that reaches 86% (zoo rating) such as lochness monster, giant tortoise, stegosaurus, camptosaurus, western manatee, and common sawfish; the former four animals are dinosaurs while the last two are marine animals. As more and more exhibits are being added so does the zoo rating increases. For example, after putting bottlenose dolphin, dolphin show, and ostrich family, the zoo rating is 86%, then adding another three zoo animals, such as, hippotamus family, black buck, and spotted hyena, the zoo rating is increased by 2%, then add four dinosaurs, the final score is 90%. Another scenario for this kind of zoo rating will be: bottlenose dolphin with its show, ostrich family, Africa buffalo, hippotamus family, and beluga, and the four dinosaurs. There is once when the zoo rating reaches 92% for 13 exhibits -- bottlenose dolphin, lochness monster, giant tortoise, stegosarus, camptosaurus, ostrich family, hippotamus family, plain zebra, beluga, black buck, spotted hyena, black rhino, and wild dog.

The best is to modify the Kids themes by removing all the existing objects except the bottlenose dolphin and its show. With just six exhibits, the zoo rating goes from 93% onwards -- ostrich family, plain zebra, western manatee, beluga, and black rhino.

You can also mix sea turtle and barracuda with whale shark family. What a challenging game!

Tuesday, January 20, 2009

store data in an array

PS> 1, 2.5, "oranges", (Get-Process svchost)

1 <--- an integer
2.5 <--- a double precision floating point number
oranges <--- a string
... <--- a Process object

how powershell expression evaluates 9 (numeric)

PS> 4 + 5

PS> $(4 + 5)

PS> "$(4 + 5)"

9

count all running processes

PS> $processCount = (get-process).count
PS> "$processCount processes running in the system."

21 processes running in the system.

backtick for dollar sign

to escape the dollar sign using a backtick

PS> $a = "hello"
PS> $b = "`$a there"
PS> $b

$a there

focus on how the powershell process object has been configured

PS> get-process powershell
| FL PSConfiguration


Name : powershell
Id : 896
PriorityClass : Normal
FileVersion : 6.1.6585.1 (fbl_srv_powershell_ctp.080411-1634)