# encoding: ascii
# api: powershell
# title: Get-CompPartitionTable
# description: Quick script to get compressed or partitioned SQL Server tables using sqlps provider
# version: 0.1
# type: module
# author: Chad Miller
# license: CC0
# x-poshcode-id: 4108
# x-archived: 2013-05-09T11:55:26
# x-published: 2013-04-15T20:33:00
#
#
param($computer,$instance,$database)

import-module sqlps -disablenamechecking

$path = "SQLSERVER:\SQL\$($computer)\$($instance)\Databases\$($database)\Tables"
SET-LOCATION $path
get-childitem | where {$_.HasCompressedPartitions -or $_.IsPartitioned} | 
select @{n='ServerInstance';e={"$computer\$instance"}},@{n='Database';e={$database}}, name, HasCompressedPartitions, IsPartitioned
cd $home
